algebra-4.3: Constructive abstract algebra

Safe Haskell Safe Haskell98

Numeric.Algebra.Class

Synopsis

# Multiplicative Semigroups

class Multiplicative r where Source #

A multiplicative semigroup

Minimal complete definition

(*)

Methods

(*) :: r -> r -> r infixl 7 Source #

pow1p :: r -> Natural -> r infixr 8 Source #

productWith1 :: Foldable1 f => (a -> r) -> f a -> r Source #

Instances

 Source # Methods(*) :: Bool -> Bool -> Bool Source #productWith1 :: Foldable1 f => (a -> Bool) -> f a -> Bool Source # Source # Methods(*) :: Int -> Int -> Int Source #productWith1 :: Foldable1 f => (a -> Int) -> f a -> Int Source # Source # Methods(*) :: Int8 -> Int8 -> Int8 Source #productWith1 :: Foldable1 f => (a -> Int8) -> f a -> Int8 Source # Source # MethodsproductWith1 :: Foldable1 f => (a -> Int16) -> f a -> Int16 Source # Source # MethodsproductWith1 :: Foldable1 f => (a -> Int32) -> f a -> Int32 Source # Source # MethodsproductWith1 :: Foldable1 f => (a -> Int64) -> f a -> Int64 Source # Source # MethodsproductWith1 :: Foldable1 f => (a -> Integer) -> f a -> Integer Source # Source # Methods(*) :: Word -> Word -> Word Source #productWith1 :: Foldable1 f => (a -> Word) -> f a -> Word Source # Source # MethodsproductWith1 :: Foldable1 f => (a -> Word8) -> f a -> Word8 Source # Source # MethodsproductWith1 :: Foldable1 f => (a -> Word16) -> f a -> Word16 Source # Source # MethodsproductWith1 :: Foldable1 f => (a -> Word32) -> f a -> Word32 Source # Source # MethodsproductWith1 :: Foldable1 f => (a -> Word64) -> f a -> Word64 Source # Source # Methods(*) :: () -> () -> () Source #pow1p :: () -> Natural -> () Source #productWith1 :: Foldable1 f => (a -> ()) -> f a -> () Source # Source # MethodsproductWith1 :: Foldable1 f => (a -> Natural) -> f a -> Natural Source # Source # MethodsproductWith1 :: Foldable1 f => (a -> Euclidean) -> f a -> Euclidean Source # Source # Methods(*) :: Fraction d -> Fraction d -> Fraction d Source #pow1p :: Fraction d -> Natural -> Fraction d Source #productWith1 :: Foldable1 f => (a -> Fraction d) -> f a -> Fraction d Source # (Commutative r, Rng r) => Multiplicative (Complex r) Source # Methods(*) :: Complex r -> Complex r -> Complex r Source #pow1p :: Complex r -> Natural -> Complex r Source #productWith1 :: Foldable1 f => (a -> Complex r) -> f a -> Complex r Source # (Commutative r, Rng r) => Multiplicative (Dual r) Source # Methods(*) :: Dual r -> Dual r -> Dual r Source #pow1p :: Dual r -> Natural -> Dual r Source #productWith1 :: Foldable1 f => (a -> Dual r) -> f a -> Dual r Source # (Commutative k, Semiring k) => Multiplicative (Hyper' k) Source # Methods(*) :: Hyper' k -> Hyper' k -> Hyper' k Source #pow1p :: Hyper' k -> Natural -> Hyper' k Source #productWith1 :: Foldable1 f => (a -> Hyper' k) -> f a -> Hyper' k Source # Source # Methods(*) :: Quaternion r -> Quaternion r -> Quaternion r Source #productWith1 :: Foldable1 f => (a -> Quaternion r) -> f a -> Quaternion r Source # (Commutative r, Rng r) => Multiplicative (Dual' r) Source # Methods(*) :: Dual' r -> Dual' r -> Dual' r Source #pow1p :: Dual' r -> Natural -> Dual' r Source #productWith1 :: Foldable1 f => (a -> Dual' r) -> f a -> Dual' r Source # Source # MethodsproductWith1 :: Foldable1 f => (a -> BasisCoblade m) -> f a -> BasisCoblade m Source # (Commutative k, Semiring k) => Multiplicative (Hyper k) Source # Methods(*) :: Hyper k -> Hyper k -> Hyper k Source #pow1p :: Hyper k -> Natural -> Hyper k Source #productWith1 :: Foldable1 f => (a -> Hyper k) -> f a -> Hyper k Source # Source # Methods(*) :: Quaternion' r -> Quaternion' r -> Quaternion' r Source #productWith1 :: Foldable1 f => (a -> Quaternion' r) -> f a -> Quaternion' r Source # (Commutative k, Rng k) => Multiplicative (Trig k) Source # Methods(*) :: Trig k -> Trig k -> Trig k Source #pow1p :: Trig k -> Natural -> Trig k Source #productWith1 :: Foldable1 f => (a -> Trig k) -> f a -> Trig k Source # Additive r => Multiplicative (Exp r) Source # Methods(*) :: Exp r -> Exp r -> Exp r Source #pow1p :: Exp r -> Natural -> Exp r Source #productWith1 :: Foldable1 f => (a -> Exp r) -> f a -> Exp r Source # Source # Methods(*) :: End r -> End r -> End r Source #pow1p :: End r -> Natural -> End r Source #productWith1 :: Foldable1 f => (a -> End r) -> f a -> End r Source # Source # Methods(*) :: Opposite r -> Opposite r -> Opposite r Source #pow1p :: Opposite r -> Natural -> Opposite r Source #productWith1 :: Foldable1 f => (a -> Opposite r) -> f a -> Opposite r Source # Rng r => Multiplicative (RngRing r) Source # Methods(*) :: RngRing r -> RngRing r -> RngRing r Source #pow1p :: RngRing r -> Natural -> RngRing r Source #productWith1 :: Foldable1 f => (a -> RngRing r) -> f a -> RngRing r Source # Source # Methods(*) :: ZeroRng r -> ZeroRng r -> ZeroRng r Source #pow1p :: ZeroRng r -> Natural -> ZeroRng r Source #productWith1 :: Foldable1 f => (a -> ZeroRng r) -> f a -> ZeroRng r Source # Algebra r a => Multiplicative (a -> r) Source # Methods(*) :: (a -> r) -> (a -> r) -> a -> r Source #pow1p :: (a -> r) -> Natural -> a -> r Source #productWith1 :: Foldable1 f => (a -> a -> r) -> f a -> a -> r Source # (Multiplicative a, Multiplicative b) => Multiplicative (a, b) Source # Methods(*) :: (a, b) -> (a, b) -> (a, b) Source #pow1p :: (a, b) -> Natural -> (a, b) Source #productWith1 :: Foldable1 f => (a -> (a, b)) -> f a -> (a, b) Source # Multiplicative (Rect i j) Source # Methods(*) :: Rect i j -> Rect i j -> Rect i j Source #pow1p :: Rect i j -> Natural -> Rect i j Source #productWith1 :: Foldable1 f => (a -> Rect i j) -> f a -> Rect i j Source # Coalgebra r m => Multiplicative (Covector r m) Source # Methods(*) :: Covector r m -> Covector r m -> Covector r m Source #pow1p :: Covector r m -> Natural -> Covector r m Source #productWith1 :: Foldable1 f => (a -> Covector r m) -> f a -> Covector r m Source # (Multiplicative a, Multiplicative b, Multiplicative c) => Multiplicative (a, b, c) Source # Methods(*) :: (a, b, c) -> (a, b, c) -> (a, b, c) Source #pow1p :: (a, b, c) -> Natural -> (a, b, c) Source #productWith1 :: Foldable1 f => (a -> (a, b, c)) -> f a -> (a, b, c) Source # Coalgebra r m => Multiplicative (Map r b m) Source # Methods(*) :: Map r b m -> Map r b m -> Map r b m Source #pow1p :: Map r b m -> Natural -> Map r b m Source #productWith1 :: Foldable1 f => (a -> Map r b m) -> f a -> Map r b m Source # (Multiplicative a, Multiplicative b, Multiplicative c, Multiplicative d) => Multiplicative (a, b, c, d) Source # Methods(*) :: (a, b, c, d) -> (a, b, c, d) -> (a, b, c, d) Source #pow1p :: (a, b, c, d) -> Natural -> (a, b, c, d) Source #productWith1 :: Foldable1 f => (a -> (a, b, c, d)) -> f a -> (a, b, c, d) Source # (Multiplicative a, Multiplicative b, Multiplicative c, Multiplicative d, Multiplicative e) => Multiplicative (a, b, c, d, e) Source # Methods(*) :: (a, b, c, d, e) -> (a, b, c, d, e) -> (a, b, c, d, e) Source #pow1p :: (a, b, c, d, e) -> Natural -> (a, b, c, d, e) Source #productWith1 :: Foldable1 f => (a -> (a, b, c, d, e)) -> f a -> (a, b, c, d, e) 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.

Instances

 Source # Source # Source # Source # Source # Source # Source # Source # Source # Source # Source # Source # Semiring () Source # Source # Source # GCDDomain d => Semiring (Fraction d) Source # (Commutative r, Rng r) => Semiring (Complex r) Source # (Commutative r, Rng r) => Semiring (Dual r) Source # (Commutative k, Semiring k) => Semiring (Hyper' k) Source # (TriviallyInvolutive r, Rng r) => Semiring (Quaternion r) Source # (Commutative r, Rng r) => Semiring (Dual' r) Source # Source # (Commutative k, Semiring k) => Semiring (Hyper k) Source # Source # (Commutative k, Rng k) => Semiring (Trig k) Source # (Abelian r, Monoidal r) => Semiring (End r) Source # Semiring r => Semiring (Opposite r) Source # Rng r => Semiring (RngRing r) Source # (Monoidal r, Abelian r) => Semiring (ZeroRng r) Source # Algebra r a => Semiring (a -> r) Source # (Semiring a, Semiring b) => Semiring (a, b) Source # Coalgebra r m => Semiring (Covector r m) Source # (Semiring a, Semiring b, Semiring c) => Semiring (a, b, c) Source # Coalgebra r m => Semiring (Map r b m) Source # (Semiring a, Semiring b, Semiring c, Semiring d) => Semiring (a, b, c, d) Source # (Semiring a, Semiring b, Semiring c, Semiring d, Semiring e) => Semiring (a, b, c, d, e) Source #

# Left and Right Modules

class (Semiring r, Additive m) => LeftModule r m where Source #

Minimal complete definition

(.*)

Methods

(.*) :: r -> m -> m infixl 7 Source #

Instances

 Source # Methods(.*) :: Integer -> Int -> Int Source # Source # Methods Source # Methods Source # Methods Source # Methods Source # Methods Source # Methods Source # Methods Source # Methods Source # Methods Source # Methods Source # Methods Additive m => LeftModule () m Source # Methods(.*) :: () -> m -> m Source # Semiring r => LeftModule r () Source # Methods(.*) :: r -> () -> () Source # Source # Methods Source # Methods(.*) :: Natural -> Int -> Int Source # Source # Methods Source # Methods Source # Methods Source # Methods Source # Methods Source # Methods Source # Methods Source # Methods Source # Methods Source # Methods Source # Methods Source # Methods Source # Methods(.*) :: Integer -> Fraction d -> Fraction d Source # Division r => LeftModule Integer (Log r) Source # Methods(.*) :: Integer -> Log r -> Log r Source # (Abelian r, Group r) => LeftModule Integer (RngRing r) Source # Methods(.*) :: Integer -> RngRing r -> RngRing r Source # Source # Methods(.*) :: Integer -> ZeroRng r -> ZeroRng r Source # LeftModule r s => LeftModule r (Complex s) Source # Methods(.*) :: r -> Complex s -> Complex s Source # LeftModule r s => LeftModule r (Dual s) Source # Methods(.*) :: r -> Dual s -> Dual s Source # LeftModule r s => LeftModule r (Hyper' s) Source # Methods(.*) :: r -> Hyper' s -> Hyper' s Source # LeftModule r s => LeftModule r (Quaternion s) Source # Methods(.*) :: r -> Quaternion s -> Quaternion s Source # LeftModule r s => LeftModule r (Dual' s) Source # Methods(.*) :: r -> Dual' s -> Dual' s Source # LeftModule r s => LeftModule r (Hyper s) Source # Methods(.*) :: r -> Hyper s -> Hyper s Source # LeftModule r s => LeftModule r (Quaternion' s) Source # Methods(.*) :: r -> Quaternion' s -> Quaternion' s Source # LeftModule r s => LeftModule r (Trig s) Source # Methods(.*) :: r -> Trig s -> Trig s Source # LeftModule r m => LeftModule r (End m) Source # Methods(.*) :: r -> End m -> End m Source # RightModule r s => LeftModule r (Opposite s) Source # Methods(.*) :: r -> Opposite s -> Opposite s Source # Source # Methods(.*) :: Natural -> Fraction d -> Fraction d Source # Source # Methods Unital r => LeftModule Natural (Log r) Source # Methods(.*) :: Natural -> Log r -> Log r Source # (Abelian r, Monoidal r) => LeftModule Natural (RngRing r) Source # Methods(.*) :: Natural -> RngRing r -> RngRing r Source # Source # Methods(.*) :: Natural -> ZeroRng r -> ZeroRng r Source # (LeftModule r a, LeftModule r b) => LeftModule r (a, b) Source # Methods(.*) :: r -> (a, b) -> (a, b) Source # LeftModule r m => LeftModule r (e -> m) Source # Methods(.*) :: r -> (e -> m) -> e -> m Source # LeftModule r s => LeftModule r (Covector s m) Source # Methods(.*) :: r -> Covector s m -> Covector s m Source # (LeftModule r a, LeftModule r b, LeftModule r c) => LeftModule r (a, b, c) Source # Methods(.*) :: r -> (a, b, c) -> (a, b, c) Source # LeftModule r s => LeftModule r (Map s b m) Source # Methods(.*) :: r -> Map s b m -> Map s b m Source # (LeftModule r a, LeftModule r b, LeftModule r c, LeftModule r d) => LeftModule r (a, b, c, d) Source # Methods(.*) :: r -> (a, b, c, d) -> (a, b, c, d) Source # (LeftModule r a, LeftModule r b, LeftModule r c, LeftModule r d, LeftModule r e) => LeftModule r (a, b, c, d, e) Source # Methods(.*) :: r -> (a, b, c, d, e) -> (a, b, c, d, e) Source # (Commutative r, Rng r) => LeftModule (Complex r) (Complex r) Source # Methods(.*) :: Complex r -> Complex r -> Complex r Source # (Commutative r, Rng r) => LeftModule (Dual r) (Dual r) Source # Methods(.*) :: Dual r -> Dual r -> Dual r Source # (Commutative r, Semiring r) => LeftModule (Hyper' r) (Hyper' r) Source # Methods(.*) :: Hyper' r -> Hyper' r -> Hyper' r Source # (TriviallyInvolutive r, Rng r) => LeftModule (Quaternion r) (Quaternion r) Source # Methods(.*) :: Quaternion r -> Quaternion r -> Quaternion r Source # (Commutative r, Rng r) => LeftModule (Dual' r) (Dual' r) Source # Methods(.*) :: Dual' r -> Dual' r -> Dual' r Source # (Commutative r, Semiring r) => LeftModule (Hyper r) (Hyper r) Source # Methods(.*) :: Hyper r -> Hyper r -> Hyper r Source # (TriviallyInvolutive r, Rng r) => LeftModule (Quaternion' r) (Quaternion' r) Source # Methods(.*) :: Quaternion' r -> Quaternion' r -> Quaternion' r Source # (Commutative r, Rng r) => LeftModule (Trig r) (Trig r) Source # Methods(.*) :: Trig r -> Trig r -> Trig r Source # (Monoidal m, Abelian m) => LeftModule (End m) (End m) Source # Methods(.*) :: End m -> End m -> End m Source # Semiring r => LeftModule (Opposite r) (Opposite r) Source # Methods(.*) :: Opposite r -> Opposite r -> Opposite r Source # Rng s => LeftModule (RngRing s) (RngRing s) Source # Methods(.*) :: RngRing s -> RngRing s -> RngRing s Source # Coalgebra r m => LeftModule (Covector r m) (Covector r m) Source # Methods(.*) :: Covector r m -> Covector r m -> Covector r m Source # Coalgebra r m => LeftModule (Map r b m) (Map r b m) Source # Methods(.*) :: Map r b m -> Map r b m -> Map r b m Source #

class (Semiring r, Additive m) => RightModule r m where Source #

Minimal complete definition

(*.)

Methods

(*.) :: m -> r -> m infixl 7 Source #

Instances

 Source # Methods(*.) :: Int -> Integer -> Int Source # Source # Methods Source # Methods Source # Methods Source # Methods Source # Methods Source # Methods Source # Methods Source # Methods Source # Methods Source # Methods Source # Methods Additive m => RightModule () m Source # Methods(*.) :: m -> () -> m Source # Semiring r => RightModule r () Source # Methods(*.) :: () -> r -> () Source # Source # Methods Source # Methods(*.) :: Int -> Natural -> Int Source # Source # Methods Source # Methods Source # Methods Source # Methods Source # Methods Source # Methods Source # Methods Source # Methods Source # Methods Source # Methods Source # Methods Source # Methods Source # Methods(*.) :: Fraction d -> Integer -> Fraction d Source # Source # Methods(*.) :: Log r -> Integer -> Log r Source # (Abelian r, Group r) => RightModule Integer (RngRing r) Source # Methods(*.) :: RngRing r -> Integer -> RngRing r Source # Source # Methods(*.) :: ZeroRng r -> Integer -> ZeroRng r Source # RightModule r s => RightModule r (Complex s) Source # Methods(*.) :: Complex s -> r -> Complex s Source # RightModule r s => RightModule r (Dual s) Source # Methods(*.) :: Dual s -> r -> Dual s Source # RightModule r s => RightModule r (Hyper' s) Source # Methods(*.) :: Hyper' s -> r -> Hyper' s Source # RightModule r s => RightModule r (Quaternion s) Source # Methods(*.) :: Quaternion s -> r -> Quaternion s Source # RightModule r s => RightModule r (Dual' s) Source # Methods(*.) :: Dual' s -> r -> Dual' s Source # RightModule r s => RightModule r (Hyper s) Source # Methods(*.) :: Hyper s -> r -> Hyper s Source # RightModule r s => RightModule r (Quaternion' s) Source # Methods(*.) :: Quaternion' s -> r -> Quaternion' s Source # RightModule r s => RightModule r (Trig s) Source # Methods(*.) :: Trig s -> r -> Trig s Source # RightModule r m => RightModule r (End m) Source # Methods(*.) :: End m -> r -> End m Source # LeftModule r s => RightModule r (Opposite s) Source # Methods(*.) :: Opposite s -> r -> Opposite s Source # Source # Methods(*.) :: Fraction d -> Natural -> Fraction d Source # Source # Methods Unital r => RightModule Natural (Log r) Source # Methods(*.) :: Log r -> Natural -> Log r Source # (Abelian r, Monoidal r) => RightModule Natural (RngRing r) Source # Methods(*.) :: RngRing r -> Natural -> RngRing r Source # Source # Methods(*.) :: ZeroRng r -> Natural -> ZeroRng r Source # (RightModule r a, RightModule r b) => RightModule r (a, b) Source # Methods(*.) :: (a, b) -> r -> (a, b) Source # RightModule r m => RightModule r (e -> m) Source # Methods(*.) :: (e -> m) -> r -> e -> m Source # RightModule r s => RightModule r (Covector s m) Source # Methods(*.) :: Covector s m -> r -> Covector s m Source # (RightModule r a, RightModule r b, RightModule r c) => RightModule r (a, b, c) Source # Methods(*.) :: (a, b, c) -> r -> (a, b, c) Source # RightModule r s => RightModule r (Map s b m) Source # Methods(*.) :: Map s b m -> r -> Map s b m Source # (RightModule r a, RightModule r b, RightModule r c, RightModule r d) => RightModule r (a, b, c, d) Source # Methods(*.) :: (a, b, c, d) -> r -> (a, b, c, d) Source # (RightModule r a, RightModule r b, RightModule r c, RightModule r d, RightModule r e) => RightModule r (a, b, c, d, e) Source # Methods(*.) :: (a, b, c, d, e) -> r -> (a, b, c, d, e) Source # (Commutative r, Rng r) => RightModule (Complex r) (Complex r) Source # Methods(*.) :: Complex r -> Complex r -> Complex r Source # (Commutative r, Rng r) => RightModule (Dual r) (Dual r) Source # Methods(*.) :: Dual r -> Dual r -> Dual r Source # (Commutative r, Semiring r) => RightModule (Hyper' r) (Hyper' r) Source # Methods(*.) :: Hyper' r -> Hyper' r -> Hyper' r Source # (TriviallyInvolutive r, Rng r) => RightModule (Quaternion r) (Quaternion r) Source # Methods(*.) :: Quaternion r -> Quaternion r -> Quaternion r Source # (Commutative r, Rng r) => RightModule (Dual' r) (Dual' r) Source # Methods(*.) :: Dual' r -> Dual' r -> Dual' r Source # (Commutative r, Semiring r) => RightModule (Hyper r) (Hyper r) Source # Methods(*.) :: Hyper r -> Hyper r -> Hyper r Source # (TriviallyInvolutive r, Rng r) => RightModule (Quaternion' r) (Quaternion' r) Source # Methods(*.) :: Quaternion' r -> Quaternion' r -> Quaternion' r Source # (Commutative r, Rng r) => RightModule (Trig r) (Trig r) Source # Methods(*.) :: Trig r -> Trig r -> Trig r Source # (Monoidal m, Abelian m) => RightModule (End m) (End m) Source # Methods(*.) :: End m -> End m -> End m Source # Semiring r => RightModule (Opposite r) (Opposite r) Source # Methods(*.) :: Opposite r -> Opposite r -> Opposite r Source # Rng s => RightModule (RngRing s) (RngRing s) Source # Methods(*.) :: RngRing s -> RngRing s -> RngRing s Source # Coalgebra r m => RightModule (Covector r m) (Covector r m) Source # Methods(*.) :: Covector r m -> Covector r m -> Covector r m Source # Coalgebra r m => RightModule (Map r b m) (Map r b m) Source # Methods(*.) :: Map r b m -> Map r b m -> Map r b m Source #

class (LeftModule r m, RightModule r m) => Module r m Source #

Instances

 (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

Minimal complete definition

zero

Methods

zero :: m Source #

sinnum :: Natural -> m -> m Source #

sumWith :: Foldable f => (a -> m) -> f a -> m Source #

Instances

 Source # MethodssumWith :: Foldable f => (a -> Bool) -> f a -> Bool Source # Source # MethodssumWith :: Foldable f => (a -> Int) -> f a -> Int Source # Source # MethodssumWith :: Foldable f => (a -> Int8) -> f a -> Int8 Source # Source # MethodssumWith :: Foldable f => (a -> Int16) -> f a -> Int16 Source # Source # MethodssumWith :: Foldable f => (a -> Int32) -> f a -> Int32 Source # Source # MethodssumWith :: Foldable f => (a -> Int64) -> f a -> Int64 Source # Source # MethodssumWith :: Foldable f => (a -> Integer) -> f a -> Integer Source # Source # MethodssumWith :: Foldable f => (a -> Word) -> f a -> Word Source # Source # MethodssumWith :: Foldable f => (a -> Word8) -> f a -> Word8 Source # Source # MethodssumWith :: Foldable f => (a -> Word16) -> f a -> Word16 Source # Source # MethodssumWith :: Foldable f => (a -> Word32) -> f a -> Word32 Source # Source # MethodssumWith :: Foldable f => (a -> Word64) -> f a -> Word64 Source # Monoidal () Source # Methodszero :: () Source #sinnum :: Natural -> () -> () Source #sumWith :: Foldable f => (a -> ()) -> f a -> () Source # Source # MethodssumWith :: Foldable f => (a -> Natural) -> f a -> Natural Source # Source # MethodssumWith :: Foldable f => (a -> Euclidean) -> f a -> Euclidean Source # GCDDomain d => Monoidal (Fraction d) Source # Methodssinnum :: Natural -> Fraction d -> Fraction d Source #sumWith :: Foldable f => (a -> Fraction d) -> f a -> Fraction d Source # Monoidal r => Monoidal (Complex r) Source # Methodssinnum :: Natural -> Complex r -> Complex r Source #sumWith :: Foldable f => (a -> Complex r) -> f a -> Complex r Source # Monoidal r => Monoidal (Dual r) Source # Methodssinnum :: Natural -> Dual r -> Dual r Source #sumWith :: Foldable f => (a -> Dual r) -> f a -> Dual r Source # Monoidal r => Monoidal (Hyper' r) Source # Methodssinnum :: Natural -> Hyper' r -> Hyper' r Source #sumWith :: Foldable f => (a -> Hyper' r) -> f a -> Hyper' r Source # Monoidal r => Monoidal (Quaternion r) Source # MethodssumWith :: Foldable f => (a -> Quaternion r) -> f a -> Quaternion r Source # Monoidal r => Monoidal (Dual' r) Source # Methodssinnum :: Natural -> Dual' r -> Dual' r Source #sumWith :: Foldable f => (a -> Dual' r) -> f a -> Dual' r Source # Source # MethodssumWith :: Foldable f => (a -> BasisCoblade m) -> f a -> BasisCoblade m Source # Monoidal r => Monoidal (Hyper r) Source # Methodssinnum :: Natural -> Hyper r -> Hyper r Source #sumWith :: Foldable f => (a -> Hyper r) -> f a -> Hyper r Source # Monoidal r => Monoidal (Quaternion' r) Source # MethodssumWith :: Foldable f => (a -> Quaternion' r) -> f a -> Quaternion' r Source # Monoidal r => Monoidal (Trig r) Source # Methodssinnum :: Natural -> Trig r -> Trig r Source #sumWith :: Foldable f => (a -> Trig r) -> f a -> Trig r Source # Unital r => Monoidal (Log r) Source # Methodssinnum :: Natural -> Log r -> Log r Source #sumWith :: Foldable f => (a -> Log r) -> f a -> Log r Source # Monoidal r => Monoidal (End r) Source # Methodssinnum :: Natural -> End r -> End r Source #sumWith :: Foldable f => (a -> End r) -> f a -> End r Source # Monoidal r => Monoidal (Opposite r) Source # Methodssinnum :: Natural -> Opposite r -> Opposite r Source #sumWith :: Foldable f => (a -> Opposite r) -> f a -> Opposite r Source # (Abelian r, Monoidal r) => Monoidal (RngRing r) Source # Methodssinnum :: Natural -> RngRing r -> RngRing r Source #sumWith :: Foldable f => (a -> RngRing r) -> f a -> RngRing r Source # Monoidal r => Monoidal (ZeroRng r) Source # Methodssinnum :: Natural -> ZeroRng r -> ZeroRng r Source #sumWith :: Foldable f => (a -> ZeroRng r) -> f a -> ZeroRng r Source # Monoidal r => Monoidal (e -> r) Source # Methodszero :: e -> r Source #sinnum :: Natural -> (e -> r) -> e -> r Source #sumWith :: Foldable f => (a -> e -> r) -> f a -> e -> r Source # (Monoidal a, Monoidal b) => Monoidal (a, b) Source # Methodszero :: (a, b) Source #sinnum :: Natural -> (a, b) -> (a, b) Source #sumWith :: Foldable f => (a -> (a, b)) -> f a -> (a, b) Source # Monoidal s => Monoidal (Covector s a) Source # Methodszero :: Covector s a Source #sinnum :: Natural -> Covector s a -> Covector s a Source #sumWith :: Foldable f => (a -> Covector s a) -> f a -> Covector s a Source # (Monoidal a, Monoidal b, Monoidal c) => Monoidal (a, b, c) Source # Methodszero :: (a, b, c) Source #sinnum :: Natural -> (a, b, c) -> (a, b, c) Source #sumWith :: Foldable f => (a -> (a, b, c)) -> f a -> (a, b, c) Source # Monoidal s => Monoidal (Map s b a) Source # Methodszero :: Map s b a Source #sinnum :: Natural -> Map s b a -> Map s b a Source #sumWith :: Foldable f => (a -> Map s b a) -> f a -> Map s b a Source # (Monoidal a, Monoidal b, Monoidal c, Monoidal d) => Monoidal (a, b, c, d) Source # Methodszero :: (a, b, c, d) Source #sinnum :: Natural -> (a, b, c, d) -> (a, b, c, d) Source #sumWith :: Foldable f => (a -> (a, b, c, d)) -> f a -> (a, b, c, d) Source # (Monoidal a, Monoidal b, Monoidal c, Monoidal d, Monoidal e) => Monoidal (a, b, c, d, e) Source # Methodszero :: (a, b, c, d, e) Source #sinnum :: Natural -> (a, b, c, d, e) -> (a, b, c, d, e) Source #sumWith :: Foldable f => (a -> (a, b, c, d, e)) -> f a -> (a, b, c, d, e) Source #

sum :: (Foldable f, Monoidal m) => f m -> m Source #

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

Minimal complete definition

mult

Methods

mult :: (a -> a -> r) -> a -> r Source #

Instances

 Algebra () a Source # Methodsmult :: (a -> a -> ()) -> a -> () Source # Source # Methodsmult :: (IntSet -> IntSet -> r) -> IntSet -> r Source # Semiring r => Algebra r () Source # Methodsmult :: (() -> () -> r) -> () -> r Source # Source # Methodsmult :: (ComplexBasis -> ComplexBasis -> k) -> ComplexBasis -> k Source # Rng k => Algebra k DualBasis Source # Methodsmult :: (DualBasis -> DualBasis -> k) -> DualBasis -> k Source # Source # Methodsmult :: (HyperBasis' -> HyperBasis' -> k) -> HyperBasis' -> k Source # Source # the quaternion algebra Methodsmult :: (QuaternionBasis -> QuaternionBasis -> r) -> QuaternionBasis -> r Source # Source # Methodsmult :: (DualBasis' -> DualBasis' -> k) -> DualBasis' -> k Source # Source # the trivial diagonal algebra Methodsmult :: (HyperBasis -> HyperBasis -> k) -> HyperBasis -> k Source # Source # the trivial diagonal algebra Methodsmult :: (QuaternionBasis' -> QuaternionBasis' -> r) -> QuaternionBasis' -> r Source # (Commutative k, Rng k) => Algebra k TrigBasis Source # Methodsmult :: (TrigBasis -> TrigBasis -> k) -> TrigBasis -> k Source # (Semiring r, Ord a) => Algebra r (Set a) Source # Methodsmult :: (Set a -> Set a -> r) -> Set a -> r Source # Semiring r => Algebra r (Seq a) Source # The tensor algebra Methodsmult :: (Seq a -> Seq a -> r) -> Seq a -> r Source # Semiring r => Algebra r [a] Source # The tensor algebra Methodsmult :: ([a] -> [a] -> r) -> [a] -> r Source # (Commutative r, Monoidal r, Semiring r, LocallyFiniteOrder a) => Algebra r (Interval a) Source # Methodsmult :: (Interval a -> Interval a -> r) -> Interval a -> r Source # (Algebra r a, Algebra r b) => Algebra r (a, b) Source # Methodsmult :: ((a, b) -> (a, b) -> r) -> (a, b) -> r Source # (Algebra r a, Algebra r b, Algebra r c) => Algebra r (a, b, c) Source # Methodsmult :: ((a, b, c) -> (a, b, c) -> r) -> (a, b, c) -> r Source # (Algebra r a, Algebra r b, Algebra r c, Algebra r d) => Algebra r (a, b, c, d) Source # Methodsmult :: ((a, b, c, d) -> (a, b, c, d) -> r) -> (a, b, c, d) -> r Source # (Algebra r a, Algebra r b, Algebra r c, Algebra r d, Algebra r e) => Algebra r (a, b, c, d, e) Source # Methodsmult :: ((a, b, c, d, e) -> (a, b, c, d, e) -> r) -> (a, b, c, d, e) -> r Source #

# Coassociative coalgebras

class Semiring r => Coalgebra r c where Source #

Minimal complete definition

comult

Methods

comult :: (c -> r) -> c -> c -> r Source #

Instances

 Source # the free commutative band coalgebra over Int Methodscomult :: (IntSet -> r) -> IntSet -> IntSet -> r Source # Semiring r => Coalgebra r () Source # Methodscomult :: (() -> r) -> () -> () -> r Source # Source # Methodscomult :: (ComplexBasis -> k) -> ComplexBasis -> ComplexBasis -> k Source # Source # Methodscomult :: (DualBasis -> k) -> DualBasis -> DualBasis -> k Source # Source # Methodscomult :: (HyperBasis' -> k) -> HyperBasis' -> HyperBasis' -> k Source # Source # the trivial diagonal coalgebra Methodscomult :: (QuaternionBasis -> r) -> QuaternionBasis -> QuaternionBasis -> r Source # Source # Methodscomult :: (DualBasis' -> k) -> DualBasis' -> DualBasis' -> k Source # Source # the hyperbolic trigonometric coalgebra Methodscomult :: (HyperBasis -> k) -> HyperBasis -> HyperBasis -> k Source # Source # dual quaternion comultiplication Methodscomult :: (QuaternionBasis' -> r) -> QuaternionBasis' -> QuaternionBasis' -> r Source # (Commutative k, Rng k) => Coalgebra k TrigBasis Source # Methodscomult :: (TrigBasis -> k) -> TrigBasis -> TrigBasis -> k Source # (Semiring r, Additive b) => Coalgebra r (IntMap b) Source # the free commutative coalgebra over a set and Int Methodscomult :: (IntMap b -> r) -> IntMap b -> IntMap b -> r Source # (Semiring r, Ord a) => Coalgebra r (Set a) Source # the free commutative band coalgebra Methodscomult :: (Set a -> r) -> Set a -> Set a -> r Source # Semiring r => Coalgebra r (Seq a) Source # The tensor Hopf algebra Methodscomult :: (Seq a -> r) -> Seq a -> Seq a -> r Source # Semiring r => Coalgebra r [a] Source # The tensor Hopf algebra Methodscomult :: ([a] -> r) -> [a] -> [a] -> r Source # (Commutative r, Monoidal r, Semiring r, PartialSemigroup a) => Coalgebra r (Morphism a) Source # Methodscomult :: (Morphism a -> r) -> Morphism a -> Morphism a -> r Source # (Eq a, Commutative r, Monoidal r, Semiring r) => Coalgebra r (Interval' a) Source # Methodscomult :: (Interval' a -> r) -> Interval' a -> Interval' a -> r Source # Eigenmetric r m => Coalgebra r (BasisCoblade m) Source # Methodscomult :: (BasisCoblade m -> r) -> BasisCoblade m -> BasisCoblade m -> r Source # (Semiring r, Ord a, Additive b) => Coalgebra r (Map a b) Source # the free commutative coalgebra over a set and a given semigroup Methodscomult :: (Map a b -> r) -> Map a b -> Map a b -> r Source # (Coalgebra r a, Coalgebra r b) => Coalgebra r (a, b) Source # Methodscomult :: ((a, b) -> r) -> (a, b) -> (a, b) -> r 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. Methodscomult :: ((m -> r) -> r) -> (m -> r) -> (m -> r) -> r Source # (Coalgebra r a, Coalgebra r b, Coalgebra r c) => Coalgebra r (a, b, c) Source # Methodscomult :: ((a, b, c) -> r) -> (a, b, c) -> (a, b, c) -> r Source # (Coalgebra r a, Coalgebra r b, Coalgebra r c, Coalgebra r d) => Coalgebra r (a, b, c, d) Source # Methodscomult :: ((a, b, c, d) -> r) -> (a, b, c, d) -> (a, b, c, d) -> r Source # (Coalgebra r a, Coalgebra r b, Coalgebra r c, Coalgebra r d, Coalgebra r e) => Coalgebra r (a, b, c, d, e) Source # Methodscomult :: ((a, b, c, d, e) -> r) -> (a, b, c, d, e) -> (a, b, c, d, e) -> r Source #