universe-0.4.0.4: Classes for types where we know all the values

Safe Haskell | None

Data.Universe

Synopsis

- class Universe a where
  - universe :: [a]
- class Universe a => Finite a where
  - universeF :: [a]

# Documentation

Bottoms are ignored for this entire module: only fully-defined inhabitants are considered inhabitants.

class Universe a where Source

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.

Methods

universe :: [a]Source

Instances

Universe Bool |
Universe Char |
Universe Int |
Universe Int8 |
Universe Int16 |
Universe Int32 |
Universe Int64 |
Universe Integer |
Universe Ordering |
Universe Word |
Universe Word8 |
Universe Word16 |
Universe Word32 |
Universe Word64 |
Universe () |
Universe All |
Universe Any |
Universe Void |
Finite a => Universe [a] |
~ * a Integer => Universe (Ratio a) |
Universe a => Universe (Dual a) |
Universe a => Universe (Sum a) |
Universe a => Universe (Product a) |
Universe a => Universe (First a) |
Universe a => Universe (Last a) |
Universe a => Universe (Maybe a) |
Universe a => Universe (Identity a) |
(Finite a, Ord a, Universe b) => Universe (a -> b) |
(Universe a, Universe b) => Universe (Either a b) |
(Universe a, Universe b) => Universe (a, b) |
(Representable f, Finite (Key f), Ord (Key f), Universe a) => Universe (Rep f a) |
Universe (f a) => Universe (IdentityT f a) |
(Universe a, Universe b, Universe c) => Universe (a, b, c) |
(Finite e, Ord e, Universe (m a)) => Universe (ReaderT e m a) |
Universe (f (g a)) => Universe (Compose f g a) |
(Universe (f a), Universe (g a)) => Universe (Product f g a) |
(Representable f, Finite s, Ord s, Finite (Key f), Ord (Key f), Universe a) => Universe (TracedT s f a) |
(Universe a, Universe b, Universe c, Universe d) => Universe (a, b, c, d) |
(Universe a, Universe b, Universe c, Universe d, Universe e) => Universe (a, b, c, d, e) |

class Universe a => Finite a where Source

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.

Methods

universeF :: [a]Source

Instances

Finite Bool |
Finite Char |
Finite Int |
Finite Int8 |
Finite Int16 |
Finite Int32 |
Finite Int64 |
Finite Ordering |
Finite Word |
Finite Word8 |
Finite Word16 |
Finite Word32 |
Finite Word64 |
Finite () |
Finite All |
Finite Any |
Finite Void |
Finite a => Finite (Dual a) |
Finite a => Finite (Sum a) |
Finite a => Finite (Product a) |
Finite a => Finite (First a) |
Finite a => Finite (Last a) |
Finite a => Finite (Maybe a) |
Finite a => Finite (Identity a) |
(Ord a, Finite a, Finite b) => Finite (a -> b) |
(Finite a, Finite b) => Finite (Either a b) |
(Finite a, Finite b) => Finite (a, b) |
(Representable f, Finite (Key f), Ord (Key f), Finite a) => Finite (Rep f a) |
Finite (f a) => Finite (IdentityT f a) |
(Finite a, Finite b, Finite c) => Finite (a, b, c) |
(Finite e, Ord e, Finite (m a)) => Finite (ReaderT e m a) |
Finite (f (g a)) => Finite (Compose f g a) |
(Finite (f a), Finite (g a)) => Finite (Product f g a) |
(Representable f, Finite s, Ord s, Finite (Key f), Ord (Key f), Finite a) => Finite (TracedT s f a) |
(Finite a, Finite b, Finite c, Finite d) => Finite (a, b, c, d) |
(Finite a, Finite b, Finite c, Finite d, Finite e) => Finite (a, b, c, d, e) |