欢迎大家赞助一杯啤酒🍺 我们准备了下酒菜:Formal mathematics/Isabelle/ML, Formal verification/Coq/ACL2, C++/F#/Lisp
Haskell
来自开放百科 - 灰狐
(版本间的差异)
小 (→简介) |
小 (→语言) |
||
第125行: | 第125行: | ||
*[https://wiki.haskell.org/Applications_and_libraries/Compilers_and_interpreters Compilers and interpreters] [https://wiki.haskell.org/Foreign_Function_Interface Foreign Function Interface (FFI)] | *[https://wiki.haskell.org/Applications_and_libraries/Compilers_and_interpreters Compilers and interpreters] [https://wiki.haskell.org/Foreign_Function_Interface Foreign Function Interface (FFI)] | ||
*[http://elm-lang.org/ Elm语言] [https://github.com/elm/compiler Elm Compiler] | *[http://elm-lang.org/ Elm语言] [https://github.com/elm/compiler Elm Compiler] | ||
+ | *[https://www.mathstat.dal.ca/~selinger/quipper/ Quipper: A Scalable Quantum Programming Language] | ||
*[https://www.hamler-lang.org/ Hamler] Haskell-style functional programming language running on [[Erlang VM]]. | *[https://www.hamler-lang.org/ Hamler] Haskell-style functional programming language running on [[Erlang VM]]. | ||
*[https://github.com/typelead/eta Eta] Modern Haskell on the [[JVM]] | *[https://github.com/typelead/eta Eta] Modern Haskell on the [[JVM]] |
2022年9月27日 (二) 08:47的版本
您可以在Wikipedia上了解到此条目的英文信息 Haskell Thanks, Wikipedia. |
Haskell
目录 |
简介
Haskell,一门开源通用型纯粹函数式编程语言(Apache v2),其特性有:静态类型,高阶函数,多态,型别类,以及单子式副作用等,Haskell 编译器几乎在每一种计算机上都可以运行。
Haskell 具有“证明即程序、命题为类型”的特征。
C++11 的 Concepts、C# 的 LINQ、Java 中的泛型、Scala、CoffeeScript、F#、Python、Swift 等语言都从中受到启发和得到灵感。
Haskell 在工业界有不少应用,最集中的是在金融界的高频交易。
更多应用:Haskell ecosystem
Brief History of Haskell Functional Programming in Haskell: Supercharge Your Coding
Why Haskell
版本
支持的语言:
现状
- 2021 State of Haskell Survey results
- 2020 State of Haskell Survey results
- 2019 State of Haskell Survey results
- 2018 State of Haskell Survey results
- 2017 State of Haskell Survey results
功能
Haskell GHC versus Java/F#/OCaml fastest programs
指南
OS X
OS X安装包安装后,会创建:
/Library/Frameworks/GHC.framework /Library/Haskell
运行 /Library/Haskell/bin/activate-hs
Haskell now set to: GHC 7.10.2 Arch. x86_64 Platform 7.10.2-a
运行 /Library/Haskell/bin/cabal
/Users/huihoo/.cabal/config /Users/huihoo/Library/Haskell/bin
vim ~/.bash_profile
export PATH="$HOME/Library/Haskell/bin:$PATH"
GHC
- GHC Proposals
- GHC GitLab GHC Team GHC Documentation
- GHC 的 LLVM 部分衍生自 Essential Haskell Compiler(EHC) 项目,GHC Backends Compiling Haskell to LLVM
已安装的 ghc 版本,使用了 Haskell Tool Stack
ls $(stack path --programs)/*.installed /home/huihoo/.stack/programs/x86_64-linux/ghc-tinfo6-8.10.7.installed /home/huihoo/.stack/programs/x86_64-linux/ghc-tinfo6-8.8.4.installed
ghci
输入ghci进入GHC交互模式
ghci> [2,4..20] [2,4,6,8,10,12,14,16,18,20] ghci> [x * 2 | x <- [1..10]] // 列表推导式(list comprehension) [2,4,6,8,10,12,14,16,18,20] ghci> [x | x <- [10..20], x /= 13, x /= 15, x /= 19] // 多个谓词(predicate) [10,11,12,14,16,17,18,20] ghci> [0.1, 0.3 .. 1] [0.1,0.3,0.5,0.7,0.8999999999999999,1.0999999999999999] ghci> [x | x <- [50..100], x `mod` 7 == 3] [52,59,66,73,80,87,94]
vim factorial.hs // 创建一个函数并保存文件
factorial :: Integer -> Integer factorial n = product [1..n] ghci> :l factorial ghci> factorial 50 30414093201713378043612608166064768844377641568960512000000000000 ghci> :t 3 ghci> :i Int
Package
- Cabal is the standard package system for Haskell software.
- Hackage-Server A Haskell Package Repository
- Stable Haskell package sets
- GHCup Install or update GHC/Cabal/HLS/Stack
项目
- Haskell Foundation
- Glasgow Haskell Compiler (GHC)
- Applications and libraries
- Haskell Package Repository
- Haskell IDE Haskell language server Haskell IDE Engine (HIE)
- ImplicitCAD
- BlockApps
- Galois, Inc.
- haskoin Bitcoin协议实现
- Language & DSL
- Berp an implementation of Python 3
- Potential x86-64 assembly as a Haskell EDSL
- Hos A Haskell operating system
- Shake build system
- Frames Data Frames for Haskell
- Gitit A wiki using HAppS, pandoc, and git
- IHP is a modern batteries-included haskell web framework, built on top of Haskell and Nix.
- PostgREST REST API for any PostgreSQL database
- Esqueleto a SQL DSL for Haskell
- The Haskell Tool Stack
语言
- Compilers and interpreters Foreign Function Interface (FFI)
- Elm语言 Elm Compiler
- Quipper: A Scalable Quantum Programming Language
- Hamler Haskell-style functional programming language running on Erlang VM.
- Eta Modern Haskell on the JVM
- PureScript A small strongly, statically typed language which compiles to JavaScript
- Idris A Dependently Typed Functional Programming Language
- Copilot Stream DSL for hard real-time runtime verification
- Frege is a Haskell for the JVM
- Berp an implementation of Python 3
- Eden Parallel Functional Programming with Haskell
- LambdaCube Compiler for LambdaCube 3D
用户服务商
- Well-Typed The Haskell Consultants
STEM
- STEM 教育可分为三部分:入门、进阶和实践,参考:Haskell :: 带类型的函数式编程
- Functional Programming 推荐
- Write You a Haskell Building a modern functional compiler from first principles.
- Functional Programming in Haskell
- What I Wish I Knew When Learning Haskell
- 24 Days of GHC Extensions
文档
- Into the Core Squeezing Haskell into nine constructors
- Haskell中的类型与类型系统
- High Availability - A Development Experience Report
- Redesigning the Computer for Security
- Functional Reporting
- Bringing Haskell to the World
- Common Pitfalls of Functional Programming and How to Avoid Them:A Mobile Gaming Platform Case Study
- Enterprise Scheduling with Haskell
图书
- 《Real World Haskell》
- 《Real World Haskell》中文翻译项目
- Learn You a Haskell for Great Good!
- Haskell :: 带类型的函数式编程 维基教科书(Wikibooks)
图集
链接
分享您的观点