Maintainer | Anders Claesson <anders.claesson@gmail.com> |
---|---|
Safe Haskell | Safe-Inferred |
License : BSD-3
Species lite. See http://github.com/akc/spe for an introduction and examples.
- type Spe a c = [a] -> [c]
- (.+.) :: Spe a b -> Spe a c -> Spe a (Either b c)
- assemble :: [Spe a c] -> Spe a c
- (.*.) :: Spe a b -> Spe a c -> Spe a (b, c)
- (<*.) :: Spe a b -> Spe a c -> Spe a (b, c)
- prod :: [Spe a b] -> Spe a [b]
- ordProd :: [Spe a b] -> Spe a [b]
- (.^) :: Spe a b -> Int -> Spe a [b]
- (<^) :: Spe a b -> Int -> Spe a [b]
- (><) :: Spe a b -> Spe a c -> Spe a (b, c)
- o :: Spe [a] b -> Spe a c -> Spe a (b, [c])
- dx :: Spe (Maybe a) b -> Spe a b
- pointed :: Spe a b -> Spe a (b, a)
- ofSize :: Spe a c -> Int -> Spe a c
- nonEmpty :: Spe a c -> Spe a c
- contact :: Ord b => Int -> Spe Int b -> Spe Int b -> Bool
- set :: Spe a [a]
- one :: Spe a [b]
- x :: Spe a a
- kBal :: Int -> Spe a [[a]]
- bal :: Spe a [[a]]
- par :: Spe a [[a]]
- kList :: Int -> Spe a [a]
- list :: Spe a [a]
- cyc :: Spe a [a]
- perm :: Spe a [[a]]
- kSubset :: Int -> Spe a [a]
- subset :: Spe a [a]
The species type synonym
type Spe a c = [a] -> [c]Source
A combinatorial species is an endofunctor on the category of finite sets and bijections. We approximate this by a function as defined.
Constructions
(<*.) :: Spe a b -> Spe a c -> Spe a (b, c)Source
Ordinal L-species multiplication. Given that the underlying set is sorted, elements in the left factor will be smaller than those in the right factor.
o :: Spe [a] b -> Spe a c -> Spe a (b, [c])Source
The (partitional) composition F(G) of two species F and G. It is usually used infix.
ofSize :: Spe a c -> Int -> Spe a cSource
f ofSize
n is like f on n element sets, but empty otherwise.
Contact of order n
contact :: Ord b => Int -> Spe Int b -> Spe Int b -> BoolSource
Check whether two species have contact of order n.
Specific species
The species characteristic of the empty set; the identity with respect to species multiplication.