01月24, 2020

Haskell

译器是 Glasgow Haskell Compiler(GHC)

http://www.haskell.org/

sudo apt-get install haskell-platform

以交互式方式运行

ghci

l 是 load 的首字

:l myFunctions

在交互式解析器中输入 :l file.hs 加载你所定义的函数,这时,解析器会输出如下信息:

Prelude> :l baby.hs
[1 of 1] Compiling Main ( baby.hs, interpreted )
Ok, modules loaded: Main.
*Main>

使用 ++ 来连接两个 List: 使用 : 操作符将一个元素放到一个列表最前面 使用 !! 使用索引访问 List 中的元素:

本文链接:https://harry.ren/post/haskell.html

-- EOF --

Comments