Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
A prelude for NumHask
- module Protolude
- (<>) :: Semigroup a => a -> a -> a
- class Semigroup a where
- module NumHask.Algebra.Additive
- module NumHask.Algebra.Basis
- module NumHask.Algebra.Distribution
- module NumHask.Algebra.Field
- module NumHask.Algebra.Integral
- module NumHask.Algebra.Magma
- module NumHask.Algebra.Metric
- module NumHask.Algebra.Module
- module NumHask.Algebra.Multiplicative
- module NumHask.Algebra.Ring
- module NumHask.Algebra.Singleton
Backend
NumHask imports Protolude as the prelude and replaces much of the Num
heirarchy in base.
Usage of Semigroup
and Monoid
has been avoided to retain basic compatability.
module Protolude
The class of semigroups (types with an associative binary operation).
Since: 4.9.0.0
(<>) :: a -> a -> a infixr 6 #
An associative operation.
(a<>
b)<>
c = a<>
(b<>
c)
If a
is also a Monoid
we further require
(<>
) =mappend
Reduce a non-empty list with <>
The default definition should be sufficient, but this can be overridden for efficiency.
stimes :: Integral b => b -> a -> a #
Repeat a value n
times.
Given that this works on a Semigroup
it is allowed to fail if
you request 0 or fewer repetitions, and the default definition
will do so.
By making this a member of the class, idempotent semigroups and monoids can
upgrade this to execute in O(1) by picking
stimes = stimesIdempotent
or stimes = stimesIdempotentMonoid
respectively.
Semigroup Ordering | Since: 4.9.0.0 |
Semigroup () | Since: 4.9.0.0 |
Semigroup Void | Since: 4.9.0.0 |
Semigroup Event | Since: 4.10.0.0 |
Semigroup Lifetime | Since: 4.10.0.0 |
Semigroup All | Since: 4.9.0.0 |
Semigroup Any | Since: 4.9.0.0 |
Semigroup IntSet | |
Semigroup Doc | |
Semigroup [a] | Since: 4.9.0.0 |
Semigroup a => Semigroup (Maybe a) | Since: 4.9.0.0 |
Semigroup a => Semigroup (IO a) | Since: 4.10.0.0 |
Ord a => Semigroup (Min a) | Since: 4.9.0.0 |
Ord a => Semigroup (Max a) | Since: 4.9.0.0 |
Semigroup (First a) | Since: 4.9.0.0 |
Semigroup (Last a) | Since: 4.9.0.0 |
Monoid m => Semigroup (WrappedMonoid m) | Since: 4.9.0.0 |
Semigroup a => Semigroup (Option a) | Since: 4.9.0.0 |
Semigroup (NonEmpty a) | Since: 4.9.0.0 |
Semigroup a => Semigroup (Identity a) | Since: 4.9.0.0 |
Semigroup a => Semigroup (Dual a) | Since: 4.9.0.0 |
Semigroup (Endo a) | Since: 4.9.0.0 |
Num a => Semigroup (Sum a) | Since: 4.9.0.0 |
Num a => Semigroup (Product a) | Since: 4.9.0.0 |
Semigroup (First a) | Since: 4.9.0.0 |
Semigroup (Last a) | Since: 4.9.0.0 |
Num a => Semigroup (Colour a) | |
Num a => Semigroup (AlphaColour a) |
|
Semigroup (IntMap a) | |
Semigroup (Seq a) | |
Ord a => Semigroup (Set a) | |
Semigroup (Doc a) | |
Semigroup b => Semigroup (a -> b) | Since: 4.9.0.0 |
Semigroup (Either a b) | Since: 4.9.0.0 |
(Semigroup a, Semigroup b) => Semigroup (a, b) | Since: 4.9.0.0 |
Semigroup (Proxy k s) | Since: 4.9.0.0 |
Ord k => Semigroup (Map k v) | |
(Semigroup a, Semigroup b, Semigroup c) => Semigroup (a, b, c) | Since: 4.9.0.0 |
Semigroup a => Semigroup (Const k a b) | Since: 4.9.0.0 |
Alternative f => Semigroup (Alt * f a) | Since: 4.9.0.0 |
Semigroup a => Semigroup (Tagged k s a) | |
Semigroup a => Semigroup (Constant k a b) | |
(Semigroup a, Semigroup b, Semigroup c, Semigroup d) => Semigroup (a, b, c, d) | Since: 4.9.0.0 |
(Semigroup a, Semigroup b, Semigroup c, Semigroup d, Semigroup e) => Semigroup (a, b, c, d, e) | Since: 4.9.0.0 |
Algebraic Heirarchy
Re-defines the numeric tower.
Instances for Int
, Integer
, Float
, Double
, Bool
and Complex
are supplied.
module NumHask.Algebra.Additive
module NumHask.Algebra.Basis
module NumHask.Algebra.Distribution
module NumHask.Algebra.Field
module NumHask.Algebra.Integral
module NumHask.Algebra.Magma
module NumHask.Algebra.Metric
module NumHask.Algebra.Module
module NumHask.Algebra.Ring
module NumHask.Algebra.Singleton