@@ -7,7 +7,7 @@ list must have the same type.
7@docs (::), (++), isEmpty, length, reverse, map
7@docs (::), (++), isEmpty, length, reverse, map
10−@docs head, tail, last, filter, take, drop
10+@docs head, tail, last, init, filter, take, drop
12# Putting Lists Together
12# Putting Lists Together
13@docs concat, concatMap, join, intersperse, zip, zipWith
13@docs concat, concatMap, join, intersperse, zip, zipWith
@@ -58,6 +58,12 @@ tail = Native.List.tail
58last : [a] -> a
58last : [a] -> a
59last = Native.List.last
59last = Native.List.last
61+{-| Extract the elements before the last element in the list. List must be non-empty.
62+`(init [1,2,3] == [1,2])
65+init = Native.List.init
61{-| Check if a list is empty `(isEmpty [] == True)` -}
67{-| Check if a list is empty `(isEmpty [] == True)` -}
62isEmpty : [a] -> Bool
68isEmpty : [a] -> Bool
63isEmpty xs =
69isEmpty xs =