Haskell学习随记(1)

Basic

. If if is be used then must appear else else boom~~~
. Less append, more reverse (not [xxxxx]++x but x:[xxxxxx]), haskell will walk through the first param
. Without variable but const
. Less ‘(’ ‘)’ and more ’ ’ (bar(a) == bar a)
. Func could join the params (div 2 1 == 2 `div` 1)
. Save your func in an awesome path, because the complier load func by path
. [a,b,c] == a : b : c: []
. [] != [[]] != [[][]]
. Index symbol : !! ([1,2,3]!!1 == 2)
. Can`t use on [] Haskell学习随记(1)_第1张图片
. Range [A…C]==[A,B,C]
. range [1,3…9]=[1,3,5,7,9] ; [‘A’,‘C’…‘Y’]=“ACEGIKMOQSUWY”
. lazy language, complier could ease the code

你可能感兴趣的:(Haskell,随记)