A list that cannot be empty. The head and tail can be accessed without Maybes.
Create a singleton list with the given element.
Create a nonempty list from an ordinary list, failing on the empty list.
Return the head of the list.
Return the tail of the list.
Convert to an ordinary list.
Nonempty lists support equality with the usual (==) operator.
Determine if the nonempty list has exactly one element.
Find the length of the nonempty list.
Add another element as the head of the list. Also available infix as
(:::); be sure to add exposing ((:::)) to your import.
Pop and discard the head, or do nothing for a singleton list. Useful if you want to exhaust a list but hang on to the last item indefinitely.
Reverse a nonempty list.
Flatten a nonempty list of nonempty lists into a single nonempty list.
Exchange the head element while leaving the tail alone.
Exchange the tail for another while leaving the head alone.
Replace the tail with the empty list while leaving the head alone.
Map a function over a nonempty list.
Map a function over two nonempty lists.
The Nonempty type. If you have both a head and tail, you can construct a nonempty list directly. Usually you'll use one of the many helpers below instead.