species-0.4: Computational combinatorial species

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

Math.Combinatorics.Species.Types

Contents

Description

Some common types used by the species library, along with some utility functions.

Synopsis

Miscellaneous

type CycleType = [(Integer, Integer)] Source #

A representation of the cycle type of a permutation. If c :: CycleType and (k,n) `elem` c, then the permutation has n cycles of size k.

Series types

newtype EGF Source #

Exponential generating functions, for counting labeled species.

Constructors

EGF 

Fields

Instances

Show EGF Source # 

Methods

showsPrec :: Int -> EGF -> ShowS #

show :: EGF -> String #

showList :: [EGF] -> ShowS #

C EGF Source # 

Methods

differentiate :: EGF -> EGF #

C EGF Source # 

Methods

(*) :: EGF -> EGF -> EGF #

one :: EGF #

fromInteger :: Integer -> EGF #

(^) :: EGF -> Integer -> EGF #

C EGF Source # 

Methods

zero :: EGF #

(+) :: EGF -> EGF -> EGF #

(-) :: EGF -> EGF -> EGF #

negate :: EGF -> EGF #

newtype GF Source #

Ordinary generating functions, for counting unlabeled species.

Constructors

GF (T Integer) 

Instances

Show GF Source # 

Methods

showsPrec :: Int -> GF -> ShowS #

show :: GF -> String #

showList :: [GF] -> ShowS #

C GF Source # 

Methods

(*) :: GF -> GF -> GF #

one :: GF #

fromInteger :: Integer -> GF #

(^) :: GF -> Integer -> GF #

C GF Source # 

Methods

zero :: GF #

(+) :: GF -> GF -> GF #

(-) :: GF -> GF -> GF #

negate :: GF -> GF #

liftGF :: (T Integer -> T Integer) -> GF -> GF Source #

liftGF2 :: (T Integer -> T Integer -> T Integer) -> GF -> GF -> GF Source #

Series utility functions

filterCoeffs :: C a => (Integer -> Bool) -> [a] -> [a] Source #

Filter the coefficients of a series according to a predicate.

selectIndex :: (C a, Eq a) => Integer -> [a] -> [a] Source #

Set every coefficient of a series to 0 except the selected index. Truncate any trailing zeroes.