-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/

-- | Classes for types where we know all the values
--   
--   Munge finite and recursively enumerable types
@package universe
@version 0.4.0.4

module Data.Universe.Helpers

-- | 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
--   
universeDef :: (Bounded a, Enum a) => [a]

-- | 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. No list's elements occur more frequently (on average)
--   than another's.
interleave :: [[a]] -> [a]

-- | Unfair n-way interleaving: given a possibly infinite number of
--   (possibly infinite) lists, produce a single list such that whenever
--   v has finite index in an input list at finite index,
--   v also has finite index in the output list. Elements from
--   lists at lower index occur more frequently, but not exponentially so.
diagonal :: [[a]] -> [a]

-- | Fair 2-way interleaving.
(+++) :: [a] -> [a] -> [a]

-- | Slightly unfair 2-way Cartesian product: given two (possibly infinite)
--   lists, produce a single list such that whenever v and
--   w have finite indices in the input lists, (v,w) has
--   finite index in the output list. Lower indices occur as the
--   fst part of the tuple more frequently, but not exponentially
--   so.
(+*+) :: [a] -> [b] -> [(a, b)]

-- | Slightly unfair n-way Cartesian product: given a finite number of
--   (possibly infinite) lists, produce a single list such that whenever
--   vi has finite index in list i for each i, [v1, ...,
--   vn] has finite index in the output list.
choices :: [[a]] -> [[a]]

-- | Very unfair 2-way Cartesian product: same guarantee as the slightly
--   unfair one, except that lower indices may occur as the fst
--   part of the tuple exponentially more frequently. This mainly exists as
--   a specification to test against.
unfairCartesianProduct :: [a] -> [b] -> [(a, b)]

-- | Very unfair n-way Cartesian product: same guarantee as the slightly
--   unfair one, but not as good in the same sense that the very unfair
--   2-way product is worse than the slightly unfair 2-way product. Mainly
--   for testing purposes.
unfairChoices :: [[a]] -> [[a]]

module Data.Universe

-- | Creating an instance of this class is a declaration that your type is
--   recursively enumerable (and that universe is that enumeration).
--   In particular, you promise that any finite inhabitant has a finite
--   index in universe, and that no inhabitant appears at two
--   different finite indices.
class Universe a where universe = universeDef
universe :: Universe a => [a]

-- | Creating an instance of this class is a declaration that your
--   universe eventually ends. Minimal definition: no methods
--   defined. By default, universeF = universe, but for some types
--   (like Either) the universeF method may have a more
--   intuitive ordering.
class Universe a => Finite a where universeF = universe
universeF :: Finite a => [a]
instance (Representable f, Finite s, Ord s, Finite (Key f), Ord (Key f), Finite a) => Finite (TracedT s f a)
instance (Representable f, Finite (Key f), Ord (Key f), Finite a) => Finite (Rep f a)
instance (Finite (f a), Finite (g a)) => Finite (Product f g a)
instance Finite (f (g a)) => Finite (Compose f g a)
instance (Finite e, Ord e, Finite (m a)) => Finite (ReaderT e m a)
instance Finite (f a) => Finite (IdentityT f a)
instance Finite a => Finite (Identity a)
instance (Ord a, Finite a, Finite b) => Finite (a -> b)
instance Finite a => Finite (Last a)
instance Finite a => Finite (First a)
instance Finite a => Finite (Dual a)
instance Finite a => Finite (Product a)
instance Finite a => Finite (Sum a)
instance Finite Any
instance Finite All
instance (Finite a, Finite b, Finite c, Finite d, Finite e) => Finite (a, b, c, d, e)
instance (Finite a, Finite b, Finite c, Finite d) => Finite (a, b, c, d)
instance (Finite a, Finite b, Finite c) => Finite (a, b, c)
instance (Finite a, Finite b) => Finite (a, b)
instance (Finite a, Finite b) => Finite (Either a b)
instance Finite a => Finite (Maybe a)
instance Finite Void
instance Finite Word64
instance Finite Word32
instance Finite Word16
instance Finite Word8
instance Finite Word
instance Finite Int64
instance Finite Int32
instance Finite Int16
instance Finite Int8
instance Finite Int
instance Finite Ordering
instance Finite Char
instance Finite Bool
instance Finite ()
instance (Representable f, Finite s, Ord s, Finite (Key f), Ord (Key f), Universe a) => Universe (TracedT s f a)
instance (Representable f, Finite (Key f), Ord (Key f), Universe a) => Universe (Rep f a)
instance (Universe (f a), Universe (g a)) => Universe (Product f g a)
instance Universe (f (g a)) => Universe (Compose f g a)
instance (Finite e, Ord e, Universe (m a)) => Universe (ReaderT e m a)
instance Universe (f a) => Universe (IdentityT f a)
instance Universe a => Universe (Identity a)
instance (Finite a, Ord a, Universe b) => Universe (a -> b)
instance a ~ Integer => Universe (Ratio a)
instance Universe a => Universe (Last a)
instance Universe a => Universe (First a)
instance Universe a => Universe (Dual a)
instance Universe a => Universe (Product a)
instance Universe a => Universe (Sum a)
instance Universe Any
instance Universe All
instance Finite a => Universe [a]
instance (Universe a, Universe b, Universe c, Universe d, Universe e) => Universe (a, b, c, d, e)
instance (Universe a, Universe b, Universe c, Universe d) => Universe (a, b, c, d)
instance (Universe a, Universe b, Universe c) => Universe (a, b, c)
instance (Universe a, Universe b) => Universe (a, b)
instance Universe a => Universe (Maybe a)
instance (Universe a, Universe b) => Universe (Either a b)
instance Universe Void
instance Universe Word64
instance Universe Word32
instance Universe Word16
instance Universe Word8
instance Universe Word
instance Universe Int64
instance Universe Int32
instance Universe Int16
instance Universe Int8
instance Universe Int
instance Universe Integer
instance Universe Ordering
instance Universe Char
instance Universe Bool
instance Universe ()

module Data.Universe.Instances.Eq
instance (Finite a, Eq b) => Eq (a -> b)

module Data.Universe.Instances.Ord
instance (Finite a, Ord b) => Ord (a -> b)

module Data.Universe.Instances.Show
instance (Finite a, Show a, Show b) => Show (a -> b)

module Data.Universe.Instances.Read
instance (Finite a, Ord a, Read a, Read b) => Read (a -> b)

module Data.Universe.Instances.Traversable
instance (Ord e, Finite e) => Traversable ((->) e)
instance Finite e => Foldable ((->) e)

module Data.Universe.Instances
