-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Combinatorial species lite
--
-- A simple library for combinatorial species. If you want something more
-- substantial, then you will most likely be happier with the species
-- package by Brent Yorgey:
-- http://hackage.haskell.org/package/species
@package spe
@version 0.2
-- | License : BSD-3
--
-- Species lite
module Math.Spe
-- | A species is an endofunctor on finite sets with bijections. We
-- approximate this by a function as defined.
type Spe a c = [a] -> [c]
-- | Binary trees
data BTree a
Empty :: BTree a
BNode :: a -> (BTree a) -> (BTree a) -> BTree a
-- | Species addition
add :: Spe a b -> Spe a c -> Spe a (Either b c)
-- | The sum of a list of species of the same type
assemble :: [Spe a c] -> Spe a c
-- | Species multiplication
mul :: Spe a b -> Spe a c -> Spe a (b, c)
-- | Ordinal L-species multiplication
mulL :: Spe a b -> Spe a c -> Spe a (b, c)
-- | The product of a list of species
prod :: [Spe a b] -> Spe a [b]
-- | The ordinal product of a list of L-species
prodL :: [Spe a b] -> Spe a [b]
-- | The power F^k for species F
power :: Spe a b -> Int -> Spe a [b]
-- | The ordinal power F^k for L-species F
powerL :: Spe a b -> Int -> Spe a [b]
-- | The composition F(G) of two species F and G
compose :: Spe [a] b -> Spe a c -> Spe a (b, [c])
-- | This is just a synonym for compose. It is usually used infix.
o :: Spe [a] b -> Spe a c -> Spe a (b, [c])
-- | The derivative d^k/dX^k F of a species F
kDiff :: Int -> Spe (Maybe a) b -> Spe a b
-- | The first derivative
diff :: Spe (Maybe a) b -> Spe a b
-- | The species of sets
set :: Spe a [a]
-- | The species characteristic of the empty set; the identity with respect
-- to species multiplication.
one :: Spe a [a]
-- | The singleton species
x :: Spe a [a]
-- | f ofSize n is like f on n element sets, but empty otherwise.
ofSize :: Spe a c -> Int -> Spe a c
-- | No structure on the empty set, but otherwise the same.
nonempty :: Spe a c -> Spe a c
-- | The species of ballots with k blocks
kBal :: Int -> Spe a [[a]]
-- | The species of ballots
bal :: Spe a [[a]]
-- | The species of set partitions
par :: Spe a [[a]]
-- | The species of lists (linear orders) with k elements
kList :: Int -> Spe a [a]
-- | The species of lists
list :: Spe a [a]
-- | The species of cycles
cyc :: Spe a [a]
-- | The species of permutations, where a permutation is a set of cycles.
perm :: Spe a [[a]]
-- | The species of k element subsets
kSubset :: Int -> Spe a ([a], [a])
-- | The species of subsets
subset :: Spe a ([a], [a])
-- | The species of binary trees
btree :: Spe a (BTree a)
instance Show a => Show (BTree a)
instance Eq a => Eq (BTree a)