Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell98 |
- class Multiplicative r where
- (*) :: r -> r -> r
- pow1p :: r -> Natural -> r
- productWith1 :: Foldable1 f => (a -> r) -> f a -> r
- 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
- (.*) :: r -> m -> m
- class (Semiring r, Additive m) => RightModule r m where
- (*.) :: m -> r -> m
- 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
- mult :: (a -> a -> r) -> a -> r
- class Semiring r => Coalgebra r c where
- comult :: (c -> r) -> c -> c -> r
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 |
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 | the free commutative band coalgebra over Int |
Semiring r => Coalgebra r () | |
Rng k => Coalgebra k ComplexBasis | |
(TriviallyInvolutive r, Rng r) => Coalgebra r QuaternionBasis | the trivial diagonal coalgebra |
Rng k => Coalgebra k DualBasis | |
(Commutative k, Monoidal k, Semiring k) => Coalgebra k HyperBasis' | |
(Commutative k, Semiring k) => Coalgebra k HyperBasis | the hyperbolic trigonometric coalgebra |
Rng k => Coalgebra k DualBasis' | |
(TriviallyInvolutive r, Rng r) => Coalgebra r QuaternionBasis' | dual quaternion comultiplication |
(Commutative k, Rng k) => Coalgebra k TrigBasis | |
(Semiring r, Additive b) => Coalgebra r (IntMap b) | the free commutative coalgebra over a set and Int |
(Semiring r, Ord a) => Coalgebra r (Set a) | the free commutative band coalgebra |
Semiring r => Coalgebra r (Seq a) | The tensor Hopf algebra |
Semiring r => Coalgebra r [a] | The tensor Hopf algebra |
(Commutative r, Monoidal r, Semiring r, PartialSemigroup a) => Coalgebra r (Morphism a) | |
(Eq a, Commutative r, Monoidal r, Semiring r) => Coalgebra r (Interval' a) | |
Eigenmetric r m => Coalgebra r (BasisCoblade m) | |
(Semiring r, Ord a, Additive b) => Coalgebra r (Map a b) | the free commutative coalgebra over a set and a given semigroup |
(Coalgebra r a, Coalgebra r b) => Coalgebra r (a, b) | |
Algebra r m => Coalgebra r (m -> r) | 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) | |
(Coalgebra r a, Coalgebra r b, Coalgebra r c, Coalgebra r d) => Coalgebra r (a, b, c, d) | |
(Coalgebra r a, Coalgebra r b, Coalgebra r c, Coalgebra r d, Coalgebra r e) => Coalgebra r (a, b, c, d, e) |