species-0.3.2: Computational combinatorial species

Stability experimental byorgey@cis.upenn.edu

Math.Combinatorics.Species.Structures

Contents

Description

Types used for expressing generic structures when enumerating species.

Synopsis

# 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.

data Void a Source

The (constantly) void functor.

Instances

 Functor Void Typeable1 Void Enumerable Void Show (Void a)

data Unit a Source

The (constantly) unit functor.

Constructors

 Unit

Instances

 Functor Unit Typeable1 Unit Enumerable Unit Show (Unit a)

newtype Const x a Source

The constant functor.

Constructors

 Const x

Instances

 Typeable2 Const Functor (Const x) Typeable x => Typeable1 (Const x) Typeable a => Enumerable (Const a) Show x => Show (Const x a)

newtype Id a Source

The identity functor.

Constructors

 Id a

Instances

 Functor Id Typeable1 Id Enumerable Id Show a => Show (Id a)

data Sum f g a Source

Functor coproduct.

Constructors

 Inl (f a) Inr (g a)

Instances

 (Functor f, Functor g) => Functor (Sum f g) (Typeable1 f, Typeable1 g) => Typeable1 (Sum f g) (Enumerable f, Enumerable g) => Enumerable (Sum f g) (Show (f a), Show (g a)) => Show (Sum f g a)

data Prod f g a Source

Functor product.

Constructors

 Prod (f a) (g a)

Instances

 (Functor f, Functor g) => Functor (Prod f g) (Typeable1 f, Typeable1 g) => Typeable1 (Prod f g) (Enumerable f, Enumerable g) => Enumerable (Prod f g) (Show (f a), Show (g a)) => Show (Prod f g a)

data Comp f g a Source

Functor composition.

Constructors

 Comp FieldsunComp :: f (g a)

Instances

 (Functor f, Functor g) => Functor (Comp f g) (Typeable1 f, Typeable1 g) => Typeable1 (Comp f g) (Enumerable f, Functor f, Enumerable g) => Enumerable (Comp f g) Show (f (g a)) => Show (Comp f g a)

newtype Cycle a Source

Cycle structure. A value of type `Cycle a` is implemented as `[a]`, but thought of as a directed cycle.

Constructors

 Cycle FieldsgetCycle :: [a]

Instances

 Functor Cycle Typeable1 Cycle Enumerable Cycle Show a => Show (Cycle a)

newtype Set a Source

Set structure. A value of type `Set a` is implemented as `[a]`, but thought of as an unordered set.

Constructors

 Set FieldsgetSet :: [a]

Instances

 Functor Set Typeable1 Set Enumerable Set Show a => Show (Set a)

data Star a Source

`Star` is isomorphic to `Maybe`, but with a more useful `Show` instance for our purposes. Used to implement species differentiation.

Constructors

 Star Original a

Instances

 Functor Star Typeable1 Star Enumerable Star Show a => Show (Star a)

data Mu f a Source

Higher-order fixpoint. `Mu f a` is morally isomorphic to ```f (Mu f) a```, except that we actually need a level of indirection. In fact `Mu f a` is isomorphic to `Interp f (Mu f) a`; `f` is a code which is interpreted by the `Interp` type function.

Constructors

 Mu FieldsunMu :: Interp f (Mu f) a

Instances

 Typeable2 Mu Typeable f => Enumerable (Mu f)

type family Interp f self :: * -> *Source

Interpretation type function for codes for higher-order type constructors, used as arguments to the higher-order fixpoint `Mu`.