species-0.1: Combinatorial species library



A data structure to reify combinatorial species.



data SpeciesAlgT s whereSource

Reified combinatorial species. Note that SpeciesAlgT has a phantom type parameter which also reflects the structure, so we can do case analysis on species at both the value and type level.

Of course, the non-uniform type parameter means that SpeciesAlgT cannot be an instance of the Species class; for that purpose the existential wrapper SpeciesAlg is provided.


data SpeciesAlg whereSource

An existential wrapper to hide the phantom type parameter to SpeciesAlgT, so we can make it an instance of Species.


SA :: ShowF (StructureF s) => SpeciesAlgT s -> SpeciesAlg 

needsZT :: SpeciesAlgT s -> BoolSource

needsZT is a predicate which checks whether a species uses any of the operations which are not supported directly by ordinary generating functions (composition and differentiation), and hence need cycle index series.

reify :: SpeciesAlg -> SpeciesAlgSource

Reify a species expression into a tree. Of course, this is just the identity function with a usefully restricted type. For example:

 > reify octopus
 (C . C'_+)

reflectT :: Species s => SpeciesAlgT f -> sSource

Reflect a species back into any instance of the Species class.

reflect :: Species s => SpeciesAlg -> sSource

A version of reflectT for the existential wrapper SpeciesAlg.