numhask-0.11.0.2: A numeric class hierarchy.
Safe HaskellSafe-Inferred
LanguageGHC2021

NumHask.Algebra.Action

Description

Algebra for Actions

Convention: the |'s in the operators point towards the higher-kinded number, representing an operator or action into a structure.

Synopsis

Documentation

class Additive (AdditiveScalar m) => AdditiveAction m where Source #

Additive Action

m |+ zero == m

Associated Types

type AdditiveScalar m :: Type Source #

Methods

(|+) :: m -> AdditiveScalar m -> m infixl 6 Source #

(+|) :: AdditiveAction m => AdditiveScalar m -> m -> m infixl 6 Source #

flipped additive action

(+|) == flip (|+)
zero +| m = m

class (AdditiveAction m, Subtractive (AdditiveScalar m)) => SubtractiveAction m where Source #

Subtractive Action

m |- zero = m

Methods

(|-) :: m -> AdditiveScalar m -> m infixl 6 Source #

(-|) :: (AdditiveAction m, Subtractive m) => AdditiveScalar m -> m -> m infixl 6 Source #

Subtraction with the scalar on the left

(-|) == (+|) . negate
zero -| m = negate m

class Multiplicative (Scalar m) => MultiplicativeAction m where Source #

Multiplicative Action

m |* one = m
m |* zero = zero

Associated Types

type Scalar m :: Type Source #

Methods

(|*) :: m -> Scalar m -> m infixl 7 Source #

Instances

Instances details
Multiplicative a => MultiplicativeAction (EuclideanPair a) Source # 
Instance details

Defined in NumHask.Algebra.Metric

Associated Types

type Scalar (EuclideanPair a) Source #

(*|) :: MultiplicativeAction m => Scalar m -> m -> m infixl 7 Source #

flipped multiplicative action

(*|) == flip (|*)
one *| m = one
zero *| m = zero

class (Divisive (Scalar m), MultiplicativeAction m) => DivisiveAction m where Source #

Divisive Action

m |/ one = m

Methods

(|/) :: m -> Scalar m -> m infixl 7 Source #

Instances

Instances details
Divisive a => DivisiveAction (EuclideanPair a) Source # 
Instance details

Defined in NumHask.Algebra.Metric

(/|) :: (MultiplicativeAction m, Divisive m) => Scalar m -> m -> m Source #

left scalar division

(/|) == (*|) . recip
one |/ m = recip m

type Module m = (Distributive (Scalar m), MultiplicativeAction m) Source #

A Module

a *| one == a
(a + b) *| c == (a *| c) + (b *| c)
c |* (a + b) == (c |* a) + (c |* b)
a *| zero == zero
a *| b == b |* a