module Numeric.Algebra.Space.MSpace
( MSpace (..),
(%.),
)
where
import Data.Kind (Constraint, Type)
import Numeric.Algebra.Multiplicative.MGroup (MGroup ((.%.)))
import Numeric.Algebra.Space.MSemiSpace (MSemiSpace)
type MSpace :: Type -> Type -> Constraint
class (MGroup k, MSemiSpace v k) => MSpace v k | v -> k where
(.%) :: v -> k -> v
infixl 7 .%
(%.) :: (MSpace v k) => k -> v -> v
%. :: forall v k. MSpace v k => k -> v -> v
(%.) = (v -> k -> v) -> k -> v -> v
forall a b c. (a -> b -> c) -> b -> a -> c
flip v -> k -> v
forall v k. MSpace v k => v -> k -> v
(.%)
{-# INLINE (%.) #-}
infixl 7 %.
instance (MGroup k) => MSpace (k, k) k where
(k
x1, k
x2) .% :: (k, k) -> k -> (k, k)
.% k
k = (k
x1 k -> k -> k
forall g. MGroup g => g -> g -> g
.%. k
k, k
x2 k -> k -> k
forall g. MGroup g => g -> g -> g
.%. k
k)
{-# INLINE (.%) #-}
instance (MGroup k) => MSpace (k, k, k) k where
(k
x1, k
x2, k
x3) .% :: (k, k, k) -> k -> (k, k, k)
.% k
k = (k
x1 k -> k -> k
forall g. MGroup g => g -> g -> g
.%. k
k, k
x2 k -> k -> k
forall g. MGroup g => g -> g -> g
.%. k
k, k
x3 k -> k -> k
forall g. MGroup g => g -> g -> g
.%. k
k)
{-# INLINE (.%) #-}
instance (MGroup k) => MSpace (k, k, k, k) k where
(k
x1, k
x2, k
x3, k
x4) .% :: (k, k, k, k) -> k -> (k, k, k, k)
.% k
k = (k
x1 k -> k -> k
forall g. MGroup g => g -> g -> g
.%. k
k, k
x2 k -> k -> k
forall g. MGroup g => g -> g -> g
.%. k
k, k
x3 k -> k -> k
forall g. MGroup g => g -> g -> g
.%. k
k, k
x4 k -> k -> k
forall g. MGroup g => g -> g -> g
.%. k
k)
{-# INLINE (.%) #-}
instance (MGroup k) => MSpace (k, k, k, k, k) k where
(k
x1, k
x2, k
x3, k
x4, k
x5) .% :: (k, k, k, k, k) -> k -> (k, k, k, k, k)
.% k
k =
( k
x1 k -> k -> k
forall g. MGroup g => g -> g -> g
.%. k
k,
k
x2 k -> k -> k
forall g. MGroup g => g -> g -> g
.%. k
k,
k
x3 k -> k -> k
forall g. MGroup g => g -> g -> g
.%. k
k,
k
x4 k -> k -> k
forall g. MGroup g => g -> g -> g
.%. k
k,
k
x5 k -> k -> k
forall g. MGroup g => g -> g -> g
.%. k
k
)
{-# INLINE (.%) #-}
instance (MGroup k) => MSpace (k, k, k, k, k, k) k where
(k
x1, k
x2, k
x3, k
x4, k
x5, k
x6) .% :: (k, k, k, k, k, k) -> k -> (k, k, k, k, k, k)
.% k
k =
( k
x1 k -> k -> k
forall g. MGroup g => g -> g -> g
.%. k
k,
k
x2 k -> k -> k
forall g. MGroup g => g -> g -> g
.%. k
k,
k
x3 k -> k -> k
forall g. MGroup g => g -> g -> g
.%. k
k,
k
x4 k -> k -> k
forall g. MGroup g => g -> g -> g
.%. k
k,
k
x5 k -> k -> k
forall g. MGroup g => g -> g -> g
.%. k
k,
k
x6 k -> k -> k
forall g. MGroup g => g -> g -> g
.%. k
k
)
{-# INLINE (.%) #-}
instance (MGroup k) => MSpace (k, k, k, k, k, k, k) k where
(k
x1, k
x2, k
x3, k
x4, k
x5, k
x6, k
x7) .% :: (k, k, k, k, k, k, k) -> k -> (k, k, k, k, k, k, k)
.% k
k =
( k
x1 k -> k -> k
forall g. MGroup g => g -> g -> g
.%. k
k,
k
x2 k -> k -> k
forall g. MGroup g => g -> g -> g
.%. k
k,
k
x3 k -> k -> k
forall g. MGroup g => g -> g -> g
.%. k
k,
k
x4 k -> k -> k
forall g. MGroup g => g -> g -> g
.%. k
k,
k
x5 k -> k -> k
forall g. MGroup g => g -> g -> g
.%. k
k,
k
x6 k -> k -> k
forall g. MGroup g => g -> g -> g
.%. k
k,
k
x7 k -> k -> k
forall g. MGroup g => g -> g -> g
.%. k
k
)
{-# INLINE (.%) #-}
instance (MGroup k) => MSpace (k, k, k, k, k, k, k, k) k where
(k
x1, k
x2, k
x3, k
x4, k
x5, k
x6, k
x7, k
x8) .% :: (k, k, k, k, k, k, k, k) -> k -> (k, k, k, k, k, k, k, k)
.% k
k =
( k
x1 k -> k -> k
forall g. MGroup g => g -> g -> g
.%. k
k,
k
x2 k -> k -> k
forall g. MGroup g => g -> g -> g
.%. k
k,
k
x3 k -> k -> k
forall g. MGroup g => g -> g -> g
.%. k
k,
k
x4 k -> k -> k
forall g. MGroup g => g -> g -> g
.%. k
k,
k
x5 k -> k -> k
forall g. MGroup g => g -> g -> g
.%. k
k,
k
x6 k -> k -> k
forall g. MGroup g => g -> g -> g
.%. k
k,
k
x7 k -> k -> k
forall g. MGroup g => g -> g -> g
.%. k
k,
k
x8 k -> k -> k
forall g. MGroup g => g -> g -> g
.%. k
k
)
{-# INLINE (.%) #-}
instance (MGroup k) => MSpace (k, k, k, k, k, k, k, k, k) k where
(k
x1, k
x2, k
x3, k
x4, k
x5, k
x6, k
x7, k
x8, k
x9) .% :: (k, k, k, k, k, k, k, k, k) -> k -> (k, k, k, k, k, k, k, k, k)
.% k
k =
( k
x1 k -> k -> k
forall g. MGroup g => g -> g -> g
.%. k
k,
k
x2 k -> k -> k
forall g. MGroup g => g -> g -> g
.%. k
k,
k
x3 k -> k -> k
forall g. MGroup g => g -> g -> g
.%. k
k,
k
x4 k -> k -> k
forall g. MGroup g => g -> g -> g
.%. k
k,
k
x5 k -> k -> k
forall g. MGroup g => g -> g -> g
.%. k
k,
k
x6 k -> k -> k
forall g. MGroup g => g -> g -> g
.%. k
k,
k
x7 k -> k -> k
forall g. MGroup g => g -> g -> g
.%. k
k,
k
x8 k -> k -> k
forall g. MGroup g => g -> g -> g
.%. k
k,
k
x9 k -> k -> k
forall g. MGroup g => g -> g -> g
.%. k
k
)
{-# INLINE (.%) #-}