-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Library providing a non-empty list datatype, and total functions operating on it -- -- When you want to state that a list should always be non-empty, you can -- use this type. This enables you to avoid the error of taking the head -- or tail of an empty list. @package NonEmpty @version 0.1 module Data.List.NonEmpty -- | Tries to convert a list to a NonEmpty. Returns the NonEmpty if it can, -- or fails in the monad otherwise. listToNonEmpty :: Monad m => [a] -> m (NonEmpty a) -- | A non-empty list data NonEmpty a NonEmpty :: a -> [a] -> NonEmpty a neHead :: NonEmpty a -> a neTail :: NonEmpty a -> [a] -- | Semantic function for NonEmpty nonEmptyToList :: NonEmpty a -> [a] -- | Length of a given NonEmpty length' :: NonEmpty a -> Int