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.
Exchange the head element while leaving the tail alone.
Replace the tail with the empty list while leaving the head alone.
Map a function over the nonempty list.
The Nonempty type. Unless you have both a head and tail, you'll normally use the provided interface.