Haskell

来自开放百科 - 灰狐
(版本间的差异)
跳转到: 导航, 搜索
(ghc)
(项目)
第76行: 第76行:
 
[https://github.com/krispo/awesome-haskell Awesome Haskell] [[image:awesome.png]]
 
[https://github.com/krispo/awesome-haskell Awesome Haskell] [[image:awesome.png]]
 
*[https://github.com/ghc/ghc Glasgow Haskell Compiler (GHC)]
 
*[https://github.com/ghc/ghc Glasgow Haskell Compiler (GHC)]
*[https://wiki.haskell.org/Applications_and_libraries Applications and libraries] [https://wiki.haskell.org/Applications_and_libraries/Compilers_and_interpreters Compilers and interpreters]
+
*[https://wiki.haskell.org/Applications_and_libraries Applications and libraries]  
 
*[https://hackage.haskell.org/ Haskell Package Repository]
 
*[https://hackage.haskell.org/ Haskell Package Repository]
 
*[[ImplicitCAD]]
 
*[[ImplicitCAD]]
 
*[https://github.com/blockapps BlockApps]
 
*[https://github.com/blockapps BlockApps]
 
*[https://github.com/GaloisInc Galois, Inc.]
 
*[https://github.com/GaloisInc Galois, Inc.]
*[http://elm-lang.org/ Elm语言] [https://github.com/elm/compiler Elm Compiler]
 
*[https://github.com/idris-lang/Idris-dev Idris] A Dependently Typed Functional Programming Language
 
*[https://github.com/copilot-language/copilot Copilot] Stream [[DSL]] for hard real-time runtime verification
 
*[https://www.hamler-lang.org/ Hamler] Haskell-style functional programming language running on [[Erlang VM]].
 
*[https://github.com/Frege/frege Frege] is a Haskell for the [[JVM]]
 
 
*[https://github.com/haskoin/haskoin haskoin] [[Bitcoin]]协议实现
 
*[https://github.com/haskoin/haskoin haskoin] [[Bitcoin]]协议实现
 
*[http://hackage.haskell.org/packages/#cat:Language Language & DSL]
 
*[http://hackage.haskell.org/packages/#cat:Language Language & DSL]
第98行: 第93行:
 
*[https://github.com/bitemyapp/esqueleto Esqueleto] a [[SQL]] [[DSL]] for Haskell
 
*[https://github.com/bitemyapp/esqueleto Esqueleto] a [[SQL]] [[DSL]] for Haskell
 
*[https://github.com/commercialhaskell/stack The Haskell Tool Stack]
 
*[https://github.com/commercialhaskell/stack The Haskell Tool Stack]
 +
 +
==语言==
 +
*[https://wiki.haskell.org/Applications_and_libraries/Compilers_and_interpreters Compilers and interpreters]
 +
*[http://elm-lang.org/ Elm语言] [https://github.com/elm/compiler Elm Compiler]
 +
*[https://github.com/idris-lang/Idris-dev Idris] A Dependently Typed Functional Programming Language
 +
*[https://github.com/copilot-language/copilot Copilot] Stream [[DSL]] for hard real-time runtime verification
 +
*[https://www.hamler-lang.org/ Hamler] Haskell-style functional programming language running on [[Erlang VM]].
 +
*[https://github.com/Frege/frege Frege] is a Haskell for the [[JVM]]
 +
*[https://github.com/bjpop/berp/ Berp] an implementation of Python 3
  
 
==用户==
 
==用户==

2021年12月5日 (日) 01:59的版本

Wikipedia-35x35.png 您可以在Wikipedia上了解到此条目的英文信息 Haskell Thanks, Wikipedia.

Haskell

Haskell-logo.png

目录

简介

Haskell,一门通用型纯粹函数式编程语言。其特性有:静态类型,高阶函数,多态,型别类,以及单子式副作用等。Haskell 编译器几乎在每一种计算机上都可以运行。

C++11 的 Concepts、C# 的 LINQ、Java 中的泛型、Scala、CoffeeScript、F#、Python、Swift 等语言都从中受到启发和得到灵感。

Haskell 在工业界有不少应用,最集中的是在金融界的高频交易。

版本

支持的语言

  • GHC2021
  • Haskell2010
  • Haskell98

功能

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 GitLab GHC Team GHC Documentation

已安装的 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

Try Haskell

输入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

Package

Cabal

项目

Hamler-logo.png
Postgrest-request-flow.png

Awesome Haskell Awesome.png

语言

用户

文档

图书

图集

链接

分享您的观点
个人工具
名字空间

变换
操作
导航
工具箱