species-0.3.2.3: Computational combinatorial species

Stabilityexperimental
Maintainerbyorgey@cis.upenn.edu
Safe HaskellNone

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.

data Unit a Source

The (constantly) unit functor.

Constructors

Unit 

newtype Const x a Source

The constant functor.

Constructors

Const x 

Instances

newtype Id a Source

The identity functor.

Constructors

Id a 

Instances

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 

Fields

unComp :: 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 

Fields

getCycle :: [a]
 

Instances

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 

Fields

getSet :: [a]
 

Instances

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 

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 

Fields

unMu :: Interp f (Mu f) a
 

Instances

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.