species-0.4.0.1: Computational combinatorial species

Copyright(c) Brent Yorgey 2010
LicenseBSD-style (see LICENSE)
Maintainerbyorgey@cis.upenn.edu
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Math.Combinatorics.Species.AST.Instances

Contents

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 -> SpeciesAST Source #

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 -> ESpeciesAST Source #

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

reflect :: Species s => SpeciesAST -> s Source #

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

reflectT :: Species s => TSpeciesAST f -> s Source #

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

reflectE :: Species s => ESpeciesAST -> s Source #

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

Orphan instances

Eq SpeciesAST Source #

Species expressions can be compared for structural equality. (Note that if s1 and s2 are isomorphic species we do not necessarily have s1 == s2.)

Note, however, that species containing an OfSize constructor will always compare as False with any other species, since we cannot decide function equality.

Ord SpeciesAST Source #

An (arbitrary) Ord instance, so that we can put species expressions in canonical order when simplifying.

Show ESpeciesAST Source # 
Show SpeciesAST Source #

Display species expressions in a nice human-readable form. Note that we commit the unforgivable sin of omitting a corresponding Read instance. This will hopefully be remedied in a future version.

C ESpeciesAST Source # 
C SpeciesAST Source #

Species expressions are differentiable.

C ESpeciesAST Source # 
C SpeciesAST Source #

Species expressions form a ring. Well, sort of. Of course the ring laws actually only hold up to isomorphism of species, not up to structural equality.

C ESpeciesAST Source # 
C SpeciesAST Source #

Species expressions are additive.

Species ESpeciesAST Source # 
Species SpeciesAST Source #

Species expressions are an instance of the Species class, so we can use the Species class DSL to build species expression ASTs.

Show (TSpeciesAST s) Source #