Safe Haskell | Safe-Inferred |
---|
- universeDef :: (Bounded a, Enum a) => [a]
- interleave :: [[a]] -> [a]
- (+++) :: [a] -> [a] -> [a]
- (+*+) :: [a] -> [b] -> [(a, b)]
Documentation
This module is for functions that are useful for writing instances, but not necessarily for using them (and hence are not exported by the main module to avoid cluttering up the namespace).
universeDef :: (Bounded a, Enum a) => [a]Source
For many types, the universe
should be [minBound .. maxBound]
;
universeDef
makes it easy to make such types an instance of Universe
via
the snippet
instance Universe Foo where universe = universeDef
interleave :: [[a]] -> [a]Source
Fair n-way interleaving: given a finite number of (possibly infinite)
lists, produce a single list such that whenever v
has finite index in one
of the input lists, v
also has finite index in the output list.