species-0.3.2.3: Computational combinatorial species

Stability experimental byorgey@cis.upenn.edu None

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) (Typeable1 (StructTy (Const a)), 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 (f :+: g) a Source

Functor coproduct.

Constructors

 Inl (f a) Inr (g a)

Instances

 (Functor f, Functor g) => Functor (:+: f g) (Typeable1 f, Typeable1 g) => Typeable1 (:+: f g) (Typeable1 (StructTy (:+: f g)), Enumerable f, Enumerable g) => Enumerable (:+: f g) (Show (f a), Show (g a)) => Show (:+: f g a)

data (f :*: g) a Source

Functor product.

Constructors

 (f a) :*: (g a)

Instances

 (Functor f, Functor g) => Functor (:*: f g) (Typeable1 f, Typeable1 g) => Typeable1 (:*: f g) (Typeable1 (StructTy (:*: f g)), Enumerable f, Enumerable g) => Enumerable (:*: f g) (Show (f a), Show (g a)) => Show (:*: f g a)

data (f :.: g) a Source

Functor composition.

Constructors

 Comp FieldsunComp :: f (g a)

Instances

 (Functor f, Functor g) => Functor (:.: f g) (Typeable1 f, Typeable1 g) => Typeable1 (:.: f g) (Typeable1 (StructTy (:.: f g)), Enumerable f, Functor f, Enumerable g) => Enumerable (:.: f g) Show (f (g a)) => Show (:.: 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 Eq a => Eq (Cycle a) 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 Eq a => Eq (Set a) 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 (Typeable1 (StructTy (Mu f)), 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`.