spe alternatives and similar packages
Based on the "Math" category.
Alternatively, view spe alternatives based on common mentions on social networks and blogs.
subhask9.8 0.0 spe VS subhaskType safe interface for working in subcategories of Hask
vector9.8 4.9 spe VS vectorAn efficient implementation of Int-indexed arrays (both mutable and immutable), with a powerful loop optimisation framework .
hmatrix9.8 0.0 spe VS hmatrixLinear algebra and numerical computation
statistics9.7 0.0 spe VS statisticsA fast, high quality library for computing with statistics in Haskell.
linear9.7 0.0 spe VS linearLow-dimensional linear algebra primitives for Haskell.
what49.4 4.9 spe VS what4Symbolic formula representation and solver interaction library
HerbiePlugin9.4 0.0 spe VS HerbiePluginGHC plugin that improves Haskell code's numerical stability
hgeometry9.3 3.1 spe VS hgeometryHGeometry is a library for computing with geometric objects in Haskell. It defines basic geometric types and primitives, and it implements some geometric data structures and algorithms. The main two focusses are: (1) Strong type safety, and (2) implementations of geometric algorithms and data structures that have good asymptotic running time guarantees.
grid9.2 0.0 spe VS gridTools for working with regular grids/graphs/lattices.
units9.2 0.0 spe VS unitsThe home of the units Haskell package
algebra9.2 0.0 spe VS algebraconstructive abstract algebra
dimensional9.1 3.7 spe VS dimensionalDimensional library variant built on Data Kinds, Closed Type Families, TypeNats (GHC 7.8+).
semigroups9.1 0.0 spe VS semigroupsHaskell 98 semigroups
hermit9.0 0.0 spe VS hermitHaskell Equational Reasoning Model-to-Implementation Tunnel
estimator9.0 0.0 spe VS estimatorState-space estimation algorithms and models
computational-algebra9.0 0.0 spe VS computational-algebraGeneral-Purpose Computer Algebra System as an EDSL in Haskell
matrix8.9 0.0 spe VS matrixA Haskell native implementation of matrices and their operations.
mwc-random8.9 1.1 spe VS mwc-randomA very fast Haskell library for generating high quality pseudo-random numbers.
hblas8.9 0.0 spe VS hblashaskell bindings for blas and lapack
numhask8.8 0.0 spe VS numhaskA haskell numeric prelude, providing a clean structure for numbers and operations that combine them.
lambda-calculator8.8 3.4 spe VS lambda-calculatorAn introduction to the Lambda Calculus
vector-space8.7 0.0 spe VS vector-spaceVector & affine spaces, linear maps, and derivatives
vector-sized8.6 0.0 spe VS vector-sizedSize tagged vectors
math-functions8.6 0.0 spe VS math-functionsSpecial mathematical functions
poly8.5 4.2 spe VS polyFast polynomial arithmetic in Haskell (dense and sparse, univariate and multivariate, usual and Laurent)
deeplearning-hs8.5 0.0 spe VS deeplearning-hsDeep Learning in Haskell
bayes-stack8.5 0.0 spe VS bayes-stackFramework for Gibbs sampling of probabilistic models
arrayfire8.5 0.0 spe VS arrayfireHaskell bindings to ArrayFire
rounded8.5 0.0 spe VS roundedMPFR bindings for Haskell
optimization8.4 0.0 spe VS optimizationSome numerical optimization methods implemented in Haskell
rampart8.3 0.0 spe VS rampart:european_castle: Determine how intervals relate to each other.
safe-decimal8.3 0.0 spe VS safe-decimalSafe and very efficient arithmetic operations on fixed decimal point numbers
equational-reasoning8.2 2.6 spe VS equational-reasoningAgda-style equational reasoning in Haskell
bed-and-breakfast8.2 0.0 spe VS bed-and-breakfastMatrix operations in 100% pure Haskell
type-natural8.2 0.0 spe VS type-naturalType-level well-kinded natural numbers.
monte-carlo8.2 0.0 spe VS monte-carloA Monte Carlo monad and transformer for Haskell.
intervals8.1 0.0 spe VS intervalsInterval Arithmetic
Decimal8.1 0.0 spe VS DecimalDecimal numbers with variable precision
simple-smt8.1 2.1 spe VS simple-smtA simple way to interact with an SMT solver process.
sbvPlugin8.1 0.0 spe VS sbvPluginFormally prove properties of Haskell programs using SBV/SMT.
monoid-subclasses7.9 0.0 spe VS monoid-subclassesSubclasses of Monoid with a solid theoretical foundation and practical purposes
mltool7.9 0.0 spe VS mltoolMachine Learning Toolbox
polynomial7.9 0.0 spe VS polynomialHaskell library for manipulating and evaluating polynomials
eigen7.9 0.0 L2 spe VS eigenHaskel binding for Eigen library. Eigen is a C++ template library for linear algebra: matrices, vectors, numerical solvers, and related algorithms.
vector-th-unbox7.8 0.0 spe VS vector-th-unboxDeriver for unboxed vectors using Template Haskell
simd7.8 0.0 spe VS simdsimple interface to ghc's simd vector support
dimensions7.8 0.0 spe VS dimensionsMany-dimensional type-safe numeric ops
manifold-random7.7 0.0 spe VS manifold-randomCoordinate-free hypersurfaces as Haskell types
Access the most powerful time series database as a service
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of spe or a related project?
spe package — species lite
A simple library for combinatorial species with no dependencies but base. For a quick taste, look at the examples below. For further information, see the reference documentation on Hackage, and the full (but short!) source code: Math/Spe.hs.
An octopus is a cycle of nonempty lists:
oct = cyc `o` nonEmpty list
A connected list is a nonempty list that begins with its smallest
[3,5,9,7] is connected but
[2,4,1] is not. Using the
ordinal product we can define the L-species of connected lists by
clist = x <*. list
x is the singleton species. Let us print a few of these
connected lists to get a feeling for how this works:
> mapM_ print $ clist [2,5,6,9] (2,[9,6,5]) (2,[9,5,6]) (2,[6,9,5]) (2,[6,5,9]) (2,[5,9,6]) (2,[5,6,9])
If we prefer to see these simply as lists rather than pairs, then we would define
clist = map (uncurry (:)) . (x <*. list)
Indeed, with this definition we have
> mapM_ print $ clist [2,5,6,9] [2,9,6,5] [2,9,5,6] [2,6,9,5] [2,6,5,9] [2,5,9,6] [2,5,6,9]
You might wonder why these lists are called "connected". It has to do
with the species
set `o` listc being isomorphic. In
g are species and
f = set `o` g then
be seen as (connected) components of
f, and those components may be
Here's an example of a recursively defined species.
data BTree a = Empty | BNode a (BTree a) (BTree a) deriving (Show, Eq) bTree :: Spe a (BTree a) bTree  = [ Empty ] bTree xs = [ BNode v l r | (v,(l,r)) <- x .*. (bTree .*. bTree) $ xs ]
We could similary use the ordinal product to define increasing binary trees, also called min-heaps:
heap :: Spe a (BTree a) heap  = [ Empty ] heap xs = [ BNode v l r | (v,(l,r)) <- x <*. (heap .*. heap) $ xs ]
The following expression evaluates to true and illustrates that the derivative of the species of cycles is isomorphic to the species of lists (linear orders):
(map catMaybes $ dx cyc [1..5]) == list [1..5]
A pointed F-structure is an F-structure together with a distinguished element (the element pointed at):
> mapM_ print $ pointed set [1..3] ([1,2,3],1) ([1,2,3],2) ([1,2,3],3)
One may note that
pointed f is isomorphic
x .*. dx f. For example,
> mapM_ print $ (x .*. dx set) [1..3] (3,[Nothing,Just 1,Just 2]) (2,[Nothing,Just 1,Just 3]) (1,[Nothing,Just 2,Just 3])
The Cartesian product
(><) of two species F and G on a set U is
obtained by superimposing both an F-structure and a G-structure on
U. For instance, pointing can be expressed using the Cartesian (and
the ordinary) species product:
pointed f = f >< (x .*. set)
Spe package doesn't provide an operator for the functorial
composition of species. This is because, for our definition of species,
it coincides with the usual composition of functions. For instance, the
species of simple undirected graphs can be defined like this:
graph = subset . kSubset 2
A ballot (or ordered set partition) is a list of blocks, where a block is simply a nonempty set. We may give ballots this type:
type Bal a = [[a]]
The ballot species can be defined by
list `o` nonEmpty set. The type
of this expression,
Spe a ([[a]],[[a]]), is, however, a bit more
complicated than we intended. Looking at the definition of partitional
mapM (nonEmpty set) bs == bs for any set partition
bs. Thus the second component is redundant, and a better definition of
the species of ballots would be
bal :: Spe a (Bal a) bal = map fst . (list `o` nonEmpty set)
The species of ballots is already defined in Math/Spe.hs. The definition given there is a bit different for reasons of efficiency.
In a recent preprint, Stuart Hannah and I study upper-triangular matrices of ballots without empty rows. Those can be defined as follows:
type Row a = [Bal a] type BalMat a = [Row a] rowOfLength :: Int -> Spe a (Row a) rowOfLength i = bal .^ i balMatOfDim :: Int -> Spe a (BalMat a) balMatOfDim k = prod [ nonEmpty (rowOfLength i) | i <- [1..k] ] balMat :: Spe a (BalMat a) balMat xs = assemble [ balMatOfDim k | k <- [0..length xs] ] xs
Further, we define the sign of a ballot matrix by
sign :: BalMat a -> Int sign m = (-1)^(dim m + blk m) where dim = length -- Matrix dimension blk = length . concat . concat -- Total number of blocks
Let us count ballot matrices with respect to this sign:
> [ sum . map sign $ balMat [1..n] | n<-[0..6] ] [1,1,3,19,207,3451,81663]
Looking up this sequence in OEIS, here using the
command line utility
sloane, we find:
$ sloane 1,1,3,19,207,3451,81663 S A079144 1,1,3,19,207,3451,81663,2602699,107477247,5581680571,356046745023, N A079144 Number of labeled interval orders on n elements: (2+2)-free posets.
In the aforementioned preprint we prove this surprising result using a sign reversing involution.
Transport of structure
h . h' = h' . h = id, we can define the transport of
structure as follows.
transport :: Functor f => (a -> b) -> (b -> a) -> Spe a (f a) -> Spe b (f b) transport h h' spe = map (fmap h) . spe . map h'
For this to work consistently we would, however, have to define some
additional newtypes and functor instances. For instance, in
bal :: Spe a [[a]] we would like
fmap to map two levels deep instead
of one level deep in
species package by Brent Yorgey
This species module was created for use in my own research. It is
sufficient for my needs. If you want something more substantial, then
you will most likely be happier with the excellent
by Brent Yorgey.