Copyright | (c) Brent Yorgey 2010 |
---|---|
License | BSD-style (see LICENSE) |
Maintainer | byorgey@cis.upenn.edu |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
Types used for expressing generic structures when enumerating species.
- data Void a
- data Unit a = Unit
- newtype Const x a = Const x
- newtype Id a = Id a
- data (f :+: g) a
- data (f :*: g) a = (f a) :*: (g a)
- data (f :.: g) a = Comp {
- unComp :: f (g a)
- newtype Cycle a = Cycle {
- getCycle :: [a]
- newtype Bracelet a = Bracelet {
- getBracelet :: [a]
- newtype Set a = Set {
- getSet :: [a]
- data Star a
- data Mu f a = Mu {}
- type family Interp f self :: * -> *
Structure functors
Functors used in building up structures for species generation. Many of these functors are already defined elsewhere, in other packages; but to avoid a plethora of imports, inconsistent naming/instance schemes, etc., we just redefine them here.
The (constantly) void functor.
The (constantly) unit functor.
The constant functor.
Const x |
The identity functor.
Id a |
Functor coproduct.
Functor product.
(f a) :*: (g a) |
Functor composition.
Cycle structure. A value of type
is implemented as
Cycle
a[a]
, but thought of as a directed cycle.
Bracelet structure. A value of type
is implemented as
Bracelet
a[a]
, but thought of as an undirected cycle (i.e. equivalent up
to rotations as well as flips/reversals).
Bracelet | |
|
Set structure. A value of type
is implemented as Set
a[a]
,
but thought of as an unordered set.