lists
’!’ elem
phrase
elem ‘p’ “cheese”
functions:
take
drop
elem
zip:将两个列表组合成元组对
length
!!: [1,2,3] !! 0 === 1
reverse
ones
编写一个带有三个参数的函数 subseq:开始位置、结束位置和列表。该函数应返回开始和结束之间的子序列。
subseq :: Int -> Int -> [a] -> [a]
subseq start end xs = take (end - start + 1) (drop start xs)