:
Prelude> head[1,2,3]
1
Prelude> head[True,False]
True
Prelude> head"Hello"
'H'
Prelude> zip[1,2,3...][4,5,6]
[(1,4),(2,5),(3,6)]
[('a',1),('b',2),('c',3)]
Prelude> fst(5,True)
5
Prelude> snd(5,True)...type RGB=(Int,Int,Int)
Prelude> let rgb=(255,255,255) ::RGB
Prelude> :t rgb
rgb :: RGB
这样处理后,你能更清楚这个变量是干什么的...Prelude Text.Show.Functions> show(<)
""
// 枚举类型类
Prelude> [1..10]
[1,2,3,4,5,6,7,8,9,10]...Prelude> :m Data.Ratio
Prelude Data.Ratio> fromInteger 5 :: Ratio Int
5 % 1
还有熟悉的向下取整方法:
Prelude> :t