@@ -7,7 +7,7 @@ list must have the same type.
77@docs (::), (++), isEmpty, length, reverse, map
88
99# Sub-lists
10−@docs head, tail, last, filter, take, drop
10+@docs head, tail, last, init, filter, take, drop
1111
1212# Putting Lists Together
1313@docs concat, concatMap, join, intersperse, zip, zipWith
@@ -58,6 +58,12 @@ tail = Native.List.tail
5858last : [a] -> a
5959last = Native.List.last
6060
61+{-| Extract the elements before the last element in the list. List must be non-empty.
62+`(init [1,2,3] == [1,2])
63+-}
64+init : [a] -> [a]
65+init = Native.List.init
66+
6167{-| Check if a list is empty `(isEmpty [] == True)` -}
6268isEmpty : [a] -> Bool
6369isEmpty xs =