Taking Notes from http://learnyouahaskell.com
Function
- infix (sanwich) : + - * /
- prefix
|
|
If Expression
|
|
List
“Hello” 只是 [‘h’,’e’,’l’,’l’,’o’] 的语法糖而已
Operators ++ : !! > >=
++ 会有遍历左边的List
12> [1, 2, 3, 4] ++ [9, 10, 11, 12][1,2,3,4,9,10,11,12]: List 前端插入元素
[1,2,3] == 1:2:3:[]!! 按照索引取得 List 中的元素, 0-based index
12> "Steven" !! 1tCompare Array > >=
12[3,2,1] > [2,1,0]True
Method
head tail last init length null reverse take drop minimum maximum sum product elem
Range
|
|
- cycle
- repeat
- replicate
|
|
List Comprehension (Filtering)
|
|
|
|
|
|
Tuple
|
|
|
|