{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE RebindableSyntax #-}
{-# OPTIONS_GHC -Wall #-}
module NumHask.Algebra.Module
( AdditiveAction (..),
SubtractiveAction (..),
MultiplicativeAction (..),
DivisiveAction (..),
Module,
)
where
import NumHask.Algebra.Additive (Additive, Subtractive)
import NumHask.Algebra.Multiplicative (Divisive, Multiplicative)
import NumHask.Algebra.Ring (Distributive)
class
(Additive a) =>
AdditiveAction m a
| m -> a
where
infixl 6 .+
(.+) :: a -> m -> m
infixl 6 +.
(+.) :: m -> a -> m
class
(Subtractive a) =>
SubtractiveAction m a
| m -> a
where
infixl 6 .-
(.-) :: a -> m -> m
infixl 6 -.
(-.) :: m -> a -> m
class
(Multiplicative a) =>
MultiplicativeAction m a
| m -> a
where
infixl 7 .*
(.*) :: a -> m -> m
infixl 7 *.
(*.) :: m -> a -> m
class
(Divisive a) =>
DivisiveAction m a
| m -> a
where
infixl 7 ./
(./) :: a -> m -> m
infixl 7 /.
(/.) :: m -> a -> m
class (Distributive a, MultiplicativeAction m a) => Module m a