-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A list with a length of at least one. -- -- A list with a length of at least one and type-safe head/tail -- operations. @package NonEmptyList @version 0.0.4 -- | A type-safe list that has at least one element. module Data.List.NonEmpty -- | An list with at least one element. data NonEmpty a -- | The head of the non-empty list. neHead :: NonEmpty a -> a -- | The tail of the non-empty list. neTail :: NonEmpty a -> [a] -- | Constructs a non-empty list with the given head and tail. nonEmpty :: a -> [a] -> NonEmpty a -- | Constructs a non-empty list with the given head and tail (an alias for -- nonEmpty). (|:) :: a -> [a] -> NonEmpty a -- | Tries to convert a list to a NonEmpty returning -- Nothing if the given list is empty. toNonEmpty :: [a] -> Maybe (NonEmpty a) -- | WARNING: Fails if given the empty list. Tries to convert a list -- to a NonEmpty. unsafeToNonEmpty :: [a] -> NonEmpty a -- | Prepends a value to a non-empty list. (.:) :: a -> NonEmpty a -> NonEmpty a -- | Prepends a non-empty list to another non-empty list. (.++) :: NonEmpty a -> NonEmpty a -> NonEmpty a -- | Reverses the elements of the (finite) non-empty list. reverse :: NonEmpty a -> NonEmpty a scanl :: (b -> a -> b) -> b -> NonEmpty a -> NonEmpty b scanl1 :: (a -> a -> a) -> NonEmpty a -> NonEmpty a scanr :: (a -> b -> b) -> b -> NonEmpty a -> NonEmpty b scanr1 :: (a -> a -> a) -> NonEmpty a -> NonEmpty a iterate :: (a -> a) -> a -> NonEmpty a cycle :: (Foldable f) => f a -> NonEmpty a inits :: [a] -> NonEmpty [a] tails :: [a] -> NonEmpty [a] sort :: (Ord a) => NonEmpty a -> NonEmpty a insert :: (Ord a) => a -> NonEmpty a -> NonEmpty a unzip :: NonEmpty (a, b) -> (NonEmpty a, NonEmpty b) prop_neHead :: String -> [String] -> Bool prop_neTail :: String -> [String] -> Bool prop_nonEmpty :: String -> [String] -> Bool prop_nonEmptyAlias :: String -> [String] -> Bool prop_toNonEmpty :: [String] -> Bool prop_unsafeNonEmpty :: [String] -> Property prop_cons :: String -> NonEmpty String -> Bool prop_append :: NonEmpty String -> NonEmpty String -> Bool prop_reverse :: NonEmpty String -> Bool instance Typeable1 NonEmpty instance (Eq a) => Eq (NonEmpty a) instance (Ord a) => Ord (NonEmpty a) instance (Data a) => Data (NonEmpty a) instance (Arbitrary a) => Arbitrary (NonEmpty a) instance (Show a) => Show (NonEmpty a) instance Traversable NonEmpty instance Foldable NonEmpty instance Monad NonEmpty instance Applicative NonEmpty instance Functor NonEmpty -- | A wrapper of NonEmpty that has a zip-like -- Applicative instance. module Data.List.ZipNonEmpty -- | A wrapper of NonEmpty that has a zip-like -- Applicative instance. data ZipNonEmpty a -- | Unwraps a zip-like non-empty list. ne :: ZipNonEmpty a -> NonEmpty a -- | Wraps a non-empty list. zipNe :: NonEmpty a -> ZipNonEmpty a -- | Runs a function for non-empty lists on zip-like non-empty lists. usingNe :: (NonEmpty a -> NonEmpty b) -> ZipNonEmpty a -> ZipNonEmpty b -- | Runs a function for zip-like non-empty lists on non-empty lists. usingZne :: (ZipNonEmpty a -> ZipNonEmpty b) -> NonEmpty a -> NonEmpty b instance (Eq a) => Eq (ZipNonEmpty a) instance (Ord a) => Ord (ZipNonEmpty a) instance Applicative ZipNonEmpty instance Functor ZipNonEmpty instance (Show a) => Show (ZipNonEmpty a)