We export some functions to work with NonEmpty. But sometimes we want functions to work with [] and return Maybe. All such functions can be expressed through nonEmpty function. So it's nice to have such combinator. Also, safeHead can be safely removed.
Add this function:
We export some functions to work with
NonEmpty
. But sometimes we want functions to work with[]
and returnMaybe
. All such functions can be expressed throughnonEmpty
function. So it's nice to have such combinator. Also,safeHead
can be safely removed.