Safe Haskell | Safe |
---|---|
Language | Haskell98 |
- class Multiplicative r where
- pow1pIntegral :: (Integral r, Integral n) => r -> n -> r
- product1 :: (Foldable1 f, Multiplicative r) => f r -> r
- class (Additive r, Abelian r, Multiplicative r) => Semiring r
- class (Semiring r, Additive m) => LeftModule r m where
- class (Semiring r, Additive m) => RightModule r m where
- class (LeftModule r m, RightModule r m) => Module r m
- class (LeftModule Natural m, RightModule Natural m) => Monoidal m where
- sum :: (Foldable f, Monoidal m) => f m -> m
- sinnumIdempotent :: (Integral n, Idempotent r, Monoidal r) => n -> r -> r
- class Semiring r => Algebra r a where
- class Semiring r => Coalgebra r c where
Multiplicative Semigroups
class Multiplicative r where Source #
A multiplicative semigroup
(*) :: r -> r -> r infixl 7 Source #
pow1p :: r -> Natural -> r infixr 8 Source #
productWith1 :: Foldable1 f => (a -> r) -> f a -> r Source #
pow1pIntegral :: (Integral r, Integral n) => r -> n -> r Source #
product1 :: (Foldable1 f, Multiplicative r) => f r -> r Source #
Semirings
class (Additive r, Abelian r, Multiplicative r) => Semiring r Source #
A pair of an additive abelian semigroup, and a multiplicative semigroup, with the distributive laws:
a(b + c) = ab + ac -- left distribution (we are a LeftNearSemiring) (a + b)c = ac + bc -- right distribution (we are a [Right]NearSemiring)
Common notation includes the laws for additive and multiplicative identity in semiring.
If you want that, look at Rig
instead.
Ideally we'd use the cyclic definition:
class (LeftModule r r, RightModule r r, Additive r, Abelian r, Multiplicative r) => Semiring r
to enforce that every semiring r is an r-module over itself, but Haskell doesn't like that.
Left and Right Modules
class (Semiring r, Additive m) => LeftModule r m where Source #
class (Semiring r, Additive m) => RightModule r m where Source #
class (LeftModule r m, RightModule r m) => Module r m Source #
(LeftModule r m, RightModule r m) => Module r m Source # | |
Additive Monoids
class (LeftModule Natural m, RightModule Natural m) => Monoidal m where Source #
An additive monoid
zero + a = a = a + zero
sinnumIdempotent :: (Integral n, Idempotent r, Monoidal r) => n -> r -> r Source #
Associative algebras
class Semiring r => Algebra r a where Source #
An associative algebra built with a free module over a semiring
Coassociative coalgebras
class Semiring r => Coalgebra r c where Source #
Semiring r => Coalgebra r IntSet Source # | the free commutative band coalgebra over Int |
Semiring r => Coalgebra r () Source # | |
(Commutative k, Rng k) => Coalgebra k TrigBasis Source # | |
(TriviallyInvolutive r, Rng r) => Coalgebra r QuaternionBasis' Source # | dual quaternion comultiplication |
(Commutative k, Semiring k) => Coalgebra k HyperBasis Source # | the hyperbolic trigonometric coalgebra |
Rng k => Coalgebra k DualBasis' Source # | |
(TriviallyInvolutive r, Rng r) => Coalgebra r QuaternionBasis Source # | the trivial diagonal coalgebra |
(Commutative k, Monoidal k, Semiring k) => Coalgebra k HyperBasis' Source # | |
Rng k => Coalgebra k DualBasis Source # | |
Rng k => Coalgebra k ComplexBasis Source # | |
(Semiring r, Additive b) => Coalgebra r (IntMap b) Source # | the free commutative coalgebra over a set and Int |
(Semiring r, Ord a) => Coalgebra r (Set a) Source # | the free commutative band coalgebra |
Semiring r => Coalgebra r (Seq a) Source # | The tensor Hopf algebra |
Semiring r => Coalgebra r [a] Source # | The tensor Hopf algebra |
(Commutative r, Monoidal r, Semiring r, PartialSemigroup a) => Coalgebra r (Morphism a) Source # | |
(Eq a, Commutative r, Monoidal r, Semiring r) => Coalgebra r (Interval' a) Source # | |
Eigenmetric r m => Coalgebra r (BasisCoblade m) Source # | |
(Semiring r, Ord a, Additive b) => Coalgebra r (Map a b) Source # | the free commutative coalgebra over a set and a given semigroup |
(Coalgebra r a, Coalgebra r b) => Coalgebra r (a, b) Source # | |
Algebra r m => Coalgebra r (m -> r) Source # | Every coalgebra gives rise to an algebra by vector space duality classically. Sadly, it requires vector space duality, which we cannot use constructively. The dual argument only relies in the fact that any constructive coalgebra can only inspect a finite number of coefficients, which we CAN exploit. |
(Coalgebra r a, Coalgebra r b, Coalgebra r c) => Coalgebra r (a, b, c) Source # | |
(Coalgebra r a, Coalgebra r b, Coalgebra r c, Coalgebra r d) => Coalgebra r (a, b, c, d) Source # | |
(Coalgebra r a, Coalgebra r b, Coalgebra r c, Coalgebra r d, Coalgebra r e) => Coalgebra r (a, b, c, d, e) Source # | |