-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Combinatorial species lite -- -- A simple library for combinatorial species with no dependencies but -- base. See http://github.com/akc/spe for an introduction and -- examples. If you want something more substantial, then you will most -- likely be happier with the excellent species package by Brent Yorgey: -- http://hackage.haskell.org/package/species @package spe @version 0.6 -- | License : BSD-3 -- -- Species lite. See http://github.com/akc/spe for an introduction -- and examples. module Math.Spe -- | A combinatorial species is an endofunctor on the category of -- finite sets and bijections. We approximate this by a function as -- defined. type Spe a c = [a] -> [c] -- | Species addition. (.+.) :: 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. (.*.) :: Spe a b -> Spe a c -> Spe a (b, c) -- | Ordinal L-species multiplication. Give that the underlying set is -- sorted , elements in the left factor will be smaller than those in the -- right factor. (<*.) :: 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. ordProd :: [Spe a b] -> Spe a [b] -- | The power F^k for species F. (.^) :: Spe a b -> Int -> Spe a [b] -- | The ordinal power F^k for L-species F. (<^) :: Spe a b -> Int -> Spe a [b] -- | The (partitional) composition F(G) of two species F and G. It is -- usually used infix. o :: Spe [a] b -> Spe a c -> Spe a (b, [c]) -- | The derivative d/dX F of a species F. dx :: Spe (Maybe a) b -> Spe a b -- | 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 sets. set :: Spe a [a] -- | The species characteristic of the empty set; the identity with respect -- to species multiplication. one :: Spe a () -- | The singleton species. x :: Spe a a -- | 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 (linear orders) list :: Spe a [a] -- | The species of cycles. cyc :: Spe a [a] -- | The species of permutations (sets of cycles). perm :: Spe a [[a]] -- | The species of k element subsets. kSubset :: Int -> Spe a [a] -- | The species of subsets. The definition given here is equivalent to -- subset = map fst . (set .*. set), but a bit faster. subset :: Spe a [a]