species-0.3.0.2: Computational combinatorial species

Stabilityexperimental
Maintainerbyorgey@cis.upenn.edu

Math.Combinatorics.Species.AST.Instances

Description

Type class instances for TSpeciesAST, ESpeciesAST, and SpeciesAST, in a separate module to avoid a dependency cycle between Math.Combinatorics.Species.AST and Math.Combinatorics.Species.Class.

This module also contains functions for reifying species expressions to ASTs and reflecting ASTs back into other species instances, which are in this module since they depend on the AST type class instances.

Synopsis

Documentation

reify :: SpeciesAST -> SpeciesASTSource

Reify a species expression into an AST. (Actually, this is just the identity function with a usefully restricted type.) For example:

 > reify octopus
 C . TL+
 > reify (ksubset 3)
 E3 * TE

reifyE :: ESpeciesAST -> ESpeciesASTSource

The same as reify, but produce a typed, size-annotated AST.

reflect :: Species s => SpeciesAST -> sSource

Reflect an AST back into any instance of the Species class.

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

Reflect a typed AST back into any instance of the Species class.

reflectE :: Species s => ESpeciesAST -> sSource

Reflect an existentially wrapped typed AST back into any instance of the Species class.