Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Nonempty lists.
Synopsis
- data NonemptyList a = (:!) {}
- unionNe :: Eq a => NonemptyList a -> NonemptyList a -> NonemptyList a
- zipWithNe :: (a -> b -> c) -> NonemptyList a -> NonemptyList b -> NonemptyList c
- zipNe :: NonemptyList a -> NonemptyList b -> NonemptyList (a, b)
- caseListNe :: [a] -> b -> (NonemptyList a -> b) -> b
- listCaseNe :: b -> (NonemptyList a -> b) -> [a] -> b
- elemNe :: Eq a => a -> NonemptyList a -> Bool
- toList :: Foldable t => t a -> [a]
Documentation
data NonemptyList a Source #
Instances
unionNe :: Eq a => NonemptyList a -> NonemptyList a -> NonemptyList a Source #
Returns the union of the argument lists seen as sets. The order of the elements in the result is not specified. Precondition: arguments contain no duplicates.
zipWithNe :: (a -> b -> c) -> NonemptyList a -> NonemptyList b -> NonemptyList c Source #
Zip two nonempty lists.
zipNe :: NonemptyList a -> NonemptyList b -> NonemptyList (a, b) Source #
Zip two nonempty lists.
caseListNe :: [a] -> b -> (NonemptyList a -> b) -> b Source #
Case on a list, getting a nonempty list in the cons case.
listCaseNe :: b -> (NonemptyList a -> b) -> [a] -> b Source #
Case on a list, with list last.