gasp-1.4.0.0: A framework of algebraic classes
Safe HaskellSafe-Inferred
LanguageHaskell2010

Algebra.Linear

Synopsis

Documentation

type VectorSpace scalar a = (Field scalar, Module scalar a, Group a) Source #

class (Finite (Rep v), Representable v, Foldable v, Applicative v) => VectorR v where Source #

Representation of vector as traversable functor ... but this is missing the link with *^ for module. We should be able to add forall s. PreRing s => Module s (v s), but this creates problems when defining instances.

Minimal complete definition

Nothing

Methods

vectorSplit :: v ~ (f g) => Dict (VectorR f, VectorR g) Source #

vectorCut :: v ~ (f g) => Dict (VectorR f, VectorR g) Source #

Instances

Instances details
VectorR Id Source # 
Instance details

Defined in Algebra.Linear

Methods

vectorSplit :: forall (f :: Type -> Type) (g :: Type -> Type). Id ~ (f g) => Dict (VectorR f, VectorR g) Source #

vectorCut :: forall (f :: Type -> Type) (g :: Type -> Type). Id ~ (f g) => Dict (VectorR f, VectorR g) Source #

VectorR a => VectorR (VNext a) Source # 
Instance details

Defined in Algebra.Linear

Methods

vectorSplit :: forall (f :: Type -> Type) (g :: Type -> Type). VNext a ~ (f g) => Dict (VectorR f, VectorR g) Source #

vectorCut :: forall (f :: Type -> Type) (g :: Type -> Type). VNext a ~ (f g) => Dict (VectorR f, VectorR g) Source #

VectorR (One :: Type -> Type) Source # 
Instance details

Defined in Algebra.Linear

Methods

vectorSplit :: forall (f :: Type -> Type) (g :: Type -> Type). One ~ (f g) => Dict (VectorR f, VectorR g) Source #

vectorCut :: forall (f :: Type -> Type) (g :: Type -> Type). One ~ (f g) => Dict (VectorR f, VectorR g) Source #

VectorR f => VectorR (Euclid f) Source # 
Instance details

Defined in Algebra.Linear

Methods

vectorSplit :: forall (f0 :: Type -> Type) (g :: Type -> Type). Euclid f ~ (f0 g) => Dict (VectorR f0, VectorR g) Source #

vectorCut :: forall (f0 :: Type -> Type) (g :: Type -> Type). Euclid f ~ (f0 g) => Dict (VectorR f0, VectorR g) Source #

(VectorR v, VectorR w) => VectorR (v w) Source # 
Instance details

Defined in Algebra.Linear

Methods

vectorSplit :: forall (f :: Type -> Type) (g :: Type -> Type). (v w) ~ (f g) => Dict (VectorR f, VectorR g) Source #

vectorCut :: forall (f :: Type -> Type) (g :: Type -> Type). (v w) ~ (f g) => Dict (VectorR f, VectorR g) Source #

(VectorR v, VectorR w) => VectorR (v w) Source # 
Instance details

Defined in Algebra.Linear

Methods

vectorSplit :: forall (f :: Type -> Type) (g :: Type -> Type). (v w) ~ (f g) => Dict (VectorR f, VectorR g) Source #

vectorCut :: forall (f :: Type -> Type) (g :: Type -> Type). (v w) ~ (f g) => Dict (VectorR f, VectorR g) Source #

class VectorR v => InnerProdSpace v where Source #

Methods

inner :: Field s => v s -> v s -> s Source #

Instances

Instances details
VectorR f => InnerProdSpace (Euclid f) Source # 
Instance details

Defined in Algebra.Linear

Methods

inner :: Field s => Euclid f s -> Euclid f s -> s Source #

type VZero x = Zero x Source #

data VNext v a Source #

Constructors

VNext 

Fields

Instances

Instances details
Representable a => Representable (VNext a) Source # 
Instance details

Defined in Algebra.Linear

Associated Types

type Rep (VNext a) #

Methods

tabulate :: (Rep (VNext a) -> a0) -> VNext a a0 #

index :: VNext a a0 -> Rep (VNext a) -> a0 #

Foldable v => Foldable (VNext v) Source # 
Instance details

Defined in Algebra.Linear

Methods

fold :: Monoid m => VNext v m -> m #

foldMap :: Monoid m => (a -> m) -> VNext v a -> m #

foldMap' :: Monoid m => (a -> m) -> VNext v a -> m #

foldr :: (a -> b -> b) -> b -> VNext v a -> b #

foldr' :: (a -> b -> b) -> b -> VNext v a -> b #

foldl :: (b -> a -> b) -> b -> VNext v a -> b #

foldl' :: (b -> a -> b) -> b -> VNext v a -> b #

foldr1 :: (a -> a -> a) -> VNext v a -> a #

foldl1 :: (a -> a -> a) -> VNext v a -> a #

toList :: VNext v a -> [a] #

null :: VNext v a -> Bool #

length :: VNext v a -> Int #

elem :: Eq a => a -> VNext v a -> Bool #

maximum :: Ord a => VNext v a -> a #

minimum :: Ord a => VNext v a -> a #

sum :: Num a => VNext v a -> a #

product :: Num a => VNext v a -> a #

Traversable v => Traversable (VNext v) Source # 
Instance details

Defined in Algebra.Linear

Methods

traverse :: Applicative f => (a -> f b) -> VNext v a -> f (VNext v b) #

sequenceA :: Applicative f => VNext v (f a) -> f (VNext v a) #

mapM :: Monad m => (a -> m b) -> VNext v a -> m (VNext v b) #

sequence :: Monad m => VNext v (m a) -> m (VNext v a) #

Applicative v => Applicative (VNext v) Source # 
Instance details

Defined in Algebra.Linear

Methods

pure :: a -> VNext v a #

(<*>) :: VNext v (a -> b) -> VNext v a -> VNext v b #

liftA2 :: (a -> b -> c) -> VNext v a -> VNext v b -> VNext v c #

(*>) :: VNext v a -> VNext v b -> VNext v b #

(<*) :: VNext v a -> VNext v b -> VNext v a #

Functor v => Functor (VNext v) Source # 
Instance details

Defined in Algebra.Linear

Methods

fmap :: (a -> b) -> VNext v a -> VNext v b #

(<$) :: a -> VNext v b -> VNext v a #

Distributive v => Distributive (VNext v) Source # 
Instance details

Defined in Algebra.Linear

Methods

distribute :: Functor f => f (VNext v a) -> VNext v (f a) #

collect :: Functor f => (a -> VNext v b) -> f a -> VNext v (f b) #

distributeM :: Monad m => m (VNext v a) -> VNext v (m a) #

collectM :: Monad m => (a -> VNext v b) -> m a -> VNext v (m b) #

IsVec f => IsVec (VNext f) Source # 
Instance details

Defined in Algebra.Linear

Methods

reifyVec :: VNext f a -> V (VNext f) a Source #

VectorR a => VectorR (VNext a) Source # 
Instance details

Defined in Algebra.Linear

Methods

vectorSplit :: forall (f :: Type -> Type) (g :: Type -> Type). VNext a ~ (f g) => Dict (VectorR f, VectorR g) Source #

vectorCut :: forall (f :: Type -> Type) (g :: Type -> Type). VNext a ~ (f g) => Dict (VectorR f, VectorR g) Source #

(Show a, Show (v a)) => Show (VNext v a) Source # 
Instance details

Defined in Algebra.Linear

Methods

showsPrec :: Int -> VNext v a -> ShowS #

show :: VNext v a -> String #

showList :: [VNext v a] -> ShowS #

(Eq a, Eq (v a)) => Eq (VNext v a) Source # 
Instance details

Defined in Algebra.Linear

Methods

(==) :: VNext v a -> VNext v a -> Bool #

(/=) :: VNext v a -> VNext v a -> Bool #

(Ord a, Ord (v a)) => Ord (VNext v a) Source # 
Instance details

Defined in Algebra.Linear

Methods

compare :: VNext v a -> VNext v a -> Ordering #

(<) :: VNext v a -> VNext v a -> Bool #

(<=) :: VNext v a -> VNext v a -> Bool #

(>) :: VNext v a -> VNext v a -> Bool #

(>=) :: VNext v a -> VNext v a -> Bool #

max :: VNext v a -> VNext v a -> VNext v a #

min :: VNext v a -> VNext v a -> VNext v a #

type Rep (VNext a) Source # 
Instance details

Defined in Algebra.Linear

type Rep (VNext a) = (One :: Type) Rep a

data V f a where Source #

Constructors

V0 :: V One a 
(:/) :: !(V f a) -> !a -> V (VNext f) a 

Instances

Instances details
Foldable (V f) Source # 
Instance details

Defined in Algebra.Linear

Methods

fold :: Monoid m => V f m -> m #

foldMap :: Monoid m => (a -> m) -> V f a -> m #

foldMap' :: Monoid m => (a -> m) -> V f a -> m #

foldr :: (a -> b -> b) -> b -> V f a -> b #

foldr' :: (a -> b -> b) -> b -> V f a -> b #

foldl :: (b -> a -> b) -> b -> V f a -> b #

foldl' :: (b -> a -> b) -> b -> V f a -> b #

foldr1 :: (a -> a -> a) -> V f a -> a #

foldl1 :: (a -> a -> a) -> V f a -> a #

toList :: V f a -> [a] #

null :: V f a -> Bool #

length :: V f a -> Int #

elem :: Eq a => a -> V f a -> Bool #

maximum :: Ord a => V f a -> a #

minimum :: Ord a => V f a -> a #

sum :: Num a => V f a -> a #

product :: Num a => V f a -> a #

Traversable (V f) Source # 
Instance details

Defined in Algebra.Linear

Methods

traverse :: Applicative f0 => (a -> f0 b) -> V f a -> f0 (V f b) #

sequenceA :: Applicative f0 => V f (f0 a) -> f0 (V f a) #

mapM :: Monad m => (a -> m b) -> V f a -> m (V f b) #

sequence :: Monad m => V f (m a) -> m (V f a) #

IsVec f => Applicative (V f) Source # 
Instance details

Defined in Algebra.Linear

Methods

pure :: a -> V f a #

(<*>) :: V f (a -> b) -> V f a -> V f b #

liftA2 :: (a -> b -> c) -> V f a -> V f b -> V f c #

(*>) :: V f a -> V f b -> V f b #

(<*) :: V f a -> V f b -> V f a #

Functor (V f) Source # 
Instance details

Defined in Algebra.Linear

Methods

fmap :: (a -> b) -> V f a -> V f b #

(<$) :: a -> V f b -> V f a #

Show a => Show (V f a) Source # 
Instance details

Defined in Algebra.Linear

Methods

showsPrec :: Int -> V f a -> ShowS #

show :: V f a -> String #

showList :: [V f a] -> ShowS #

Eq a => Eq (V f a) Source # 
Instance details

Defined in Algebra.Linear

Methods

(==) :: V f a -> V f a -> Bool #

(/=) :: V f a -> V f a -> Bool #

class (Foldable f, Applicative f) => IsVec f where Source #

Methods

reifyVec :: f a -> V f a Source #

Instances

Instances details
IsVec f => IsVec (VNext f) Source # 
Instance details

Defined in Algebra.Linear

Methods

reifyVec :: VNext f a -> V (VNext f) a Source #

IsVec (One :: Type -> Type) Source # 
Instance details

Defined in Algebra.Linear

Methods

reifyVec :: One a -> V One a Source #

fromV :: V f a -> f a Source #

pattern V1' :: a -> V1' a Source #

pattern V2' :: forall a. a -> a -> V2' a Source #

pattern V3' :: forall a. a -> a -> a -> V3' a Source #

newtype Euclid f a Source #

Make a Euclidean vector out of a traversable functor. (The p)

Constructors

Euclid 

Fields

Instances

Instances details
(Functor f, Scalable s a) => Scalable s (Euclid f a) Source # 
Instance details

Defined in Algebra.Linear

Methods

(*^) :: s -> Euclid f a -> Euclid f a Source #

Representable f => Representable (Euclid f) Source # 
Instance details

Defined in Algebra.Linear

Associated Types

type Rep (Euclid f) #

Methods

tabulate :: (Rep (Euclid f) -> a) -> Euclid f a #

index :: Euclid f a -> Rep (Euclid f) -> a #

Foldable f => Foldable (Euclid f) Source # 
Instance details

Defined in Algebra.Linear

Methods

fold :: Monoid m => Euclid f m -> m #

foldMap :: Monoid m => (a -> m) -> Euclid f a -> m #

foldMap' :: Monoid m => (a -> m) -> Euclid f a -> m #

foldr :: (a -> b -> b) -> b -> Euclid f a -> b #

foldr' :: (a -> b -> b) -> b -> Euclid f a -> b #

foldl :: (b -> a -> b) -> b -> Euclid f a -> b #

foldl' :: (b -> a -> b) -> b -> Euclid f a -> b #

foldr1 :: (a -> a -> a) -> Euclid f a -> a #

foldl1 :: (a -> a -> a) -> Euclid f a -> a #

toList :: Euclid f a -> [a] #

null :: Euclid f a -> Bool #

length :: Euclid f a -> Int #

elem :: Eq a => a -> Euclid f a -> Bool #

maximum :: Ord a => Euclid f a -> a #

minimum :: Ord a => Euclid f a -> a #

sum :: Num a => Euclid f a -> a #

product :: Num a => Euclid f a -> a #

Traversable f => Traversable (Euclid f) Source # 
Instance details

Defined in Algebra.Linear

Methods

traverse :: Applicative f0 => (a -> f0 b) -> Euclid f a -> f0 (Euclid f b) #

sequenceA :: Applicative f0 => Euclid f (f0 a) -> f0 (Euclid f a) #

mapM :: Monad m => (a -> m b) -> Euclid f a -> m (Euclid f b) #

sequence :: Monad m => Euclid f (m a) -> m (Euclid f a) #

Applicative f => Applicative (Euclid f) Source # 
Instance details

Defined in Algebra.Linear

Methods

pure :: a -> Euclid f a #

(<*>) :: Euclid f (a -> b) -> Euclid f a -> Euclid f b #

liftA2 :: (a -> b -> c) -> Euclid f a -> Euclid f b -> Euclid f c #

(*>) :: Euclid f a -> Euclid f b -> Euclid f b #

(<*) :: Euclid f a -> Euclid f b -> Euclid f a #

Functor f => Functor (Euclid f) Source # 
Instance details

Defined in Algebra.Linear

Methods

fmap :: (a -> b) -> Euclid f a -> Euclid f b #

(<$) :: a -> Euclid f b -> Euclid f a #

Distributive f => Distributive (Euclid f) Source # 
Instance details

Defined in Algebra.Linear

Methods

distribute :: Functor f0 => f0 (Euclid f a) -> Euclid f (f0 a) #

collect :: Functor f0 => (a -> Euclid f b) -> f0 a -> Euclid f (f0 b) #

distributeM :: Monad m => m (Euclid f a) -> Euclid f (m a) #

collectM :: Monad m => (a -> Euclid f b) -> m a -> Euclid f (m b) #

VectorR f => InnerProdSpace (Euclid f) Source # 
Instance details

Defined in Algebra.Linear

Methods

inner :: Field s => Euclid f s -> Euclid f s -> s Source #

VectorR f => VectorR (Euclid f) Source # 
Instance details

Defined in Algebra.Linear

Methods

vectorSplit :: forall (f0 :: Type -> Type) (g :: Type -> Type). Euclid f ~ (f0 g) => Dict (VectorR f0, VectorR g) Source #

vectorCut :: forall (f0 :: Type -> Type) (g :: Type -> Type). Euclid f ~ (f0 g) => Dict (VectorR f0, VectorR g) Source #

Show (f a) => Show (Euclid f a) Source # 
Instance details

Defined in Algebra.Linear

Methods

showsPrec :: Int -> Euclid f a -> ShowS #

show :: Euclid f a -> String #

showList :: [Euclid f a] -> ShowS #

(Applicative f, Additive a) => Additive (Euclid f a) Source # 
Instance details

Defined in Algebra.Linear

Methods

(+) :: Euclid f a -> Euclid f a -> Euclid f a Source #

zero :: Euclid f a Source #

times :: Natural -> Euclid f a -> Euclid f a Source #

(Applicative f, Group a) => Group (Euclid f a) Source # 
Instance details

Defined in Algebra.Linear

Methods

(-) :: Euclid f a -> Euclid f a -> Euclid f a Source #

subtract :: Euclid f a -> Euclid f a -> Euclid f a Source #

negate :: Euclid f a -> Euclid f a Source #

mult :: Integer -> Euclid f a -> Euclid f a Source #

Eq (f a) => Eq (Euclid f a) Source # 
Instance details

Defined in Algebra.Linear

Methods

(==) :: Euclid f a -> Euclid f a -> Bool #

(/=) :: Euclid f a -> Euclid f a -> Bool #

Ord (f a) => Ord (Euclid f a) Source # 
Instance details

Defined in Algebra.Linear

Methods

compare :: Euclid f a -> Euclid f a -> Ordering #

(<) :: Euclid f a -> Euclid f a -> Bool #

(<=) :: Euclid f a -> Euclid f a -> Bool #

(>) :: Euclid f a -> Euclid f a -> Bool #

(>=) :: Euclid f a -> Euclid f a -> Bool #

max :: Euclid f a -> Euclid f a -> Euclid f a #

min :: Euclid f a -> Euclid f a -> Euclid f a #

type Rep (Euclid f) Source # 
Instance details

Defined in Algebra.Linear

type Rep (Euclid f) = Rep f

pattern V2 :: forall a. a -> a -> Euclid V2' a Source #

pattern V3 :: forall a. a -> a -> a -> Euclid V3' a Source #

pureMat :: (Applicative v, Applicative w) => s -> Mat s v w Source #

(⊙) :: Applicative v => Multiplicative s => v s -> v s -> v s Source #

Hadamard product

(·) :: Field s => InnerProdSpace v => v s -> v s -> s Source #

sqNorm :: Field s => InnerProdSpace v => v s -> s Source #

norm :: Algebraic s => InnerProdSpace v => v s -> s Source #

normalize :: VectorSpace s (v s) => Algebraic s => InnerProdSpace v => v s -> v s Source #

(×) :: Ring a => V3 a -> V3 a -> V3 a Source #

Cross product in 3 dimensions https://en.wikipedia.org/wiki/Cross_product

type SqMat v s = Mat s v v Source #

newtype Mat s w v Source #

Matrix type. (w s) is a column. (v s) is a row.

Constructors

Mat 

Fields

Instances

Instances details
(Functor f, Functor g, Scalable s a) => Scalable s (Mat a f g) Source # 
Instance details

Defined in Algebra.Linear

Methods

(*^) :: s -> Mat a f g -> Mat a f g Source #

Ring s => Braided ((⊗) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (One :: Type -> Type) (Mat s :: (Type -> Type) -> (Type -> Type) -> Type) Source # 
Instance details

Defined in Algebra.Linear

Methods

swap :: forall (a :: k) (b :: k). (Obj (Mat s) a, Obj (Mat s) b) => Mat s (a b) (b a) Source #

swap_ :: forall (a :: k) (b :: k). (Obj (Mat s) a, Obj (Mat s) b) => Mat s (a b) (b a) Source #

Ring s => Cartesian ((⊗) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (One :: Type -> Type) (Mat s :: (Type -> Type) -> (Type -> Type) -> Type) Source # 
Instance details

Defined in Algebra.Linear

Methods

exl :: forall (a :: k) (b :: k). O2 (Mat s) a b => Mat s (a b) a Source #

exr :: forall (a :: k) (b :: k). O2 (Mat s) a b => Mat s (a b) b Source #

dis :: forall (a :: k). Obj (Mat s) a => Mat s a One Source #

dup :: forall (a :: k). Obj (Mat s) a => Mat s a (a a) Source #

(▵) :: forall (a :: k) (b :: k) (c :: k). (Obj (Mat s) a, Obj (Mat s) b, Obj (Mat s) c) => Mat s a b -> Mat s a c -> Mat s a (b c) Source #

Ring s => CoCartesian ((⊗) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (One :: Type -> Type) (Mat s :: (Type -> Type) -> (Type -> Type) -> Type) Source # 
Instance details

Defined in Algebra.Linear

Methods

inl :: forall (a :: k) (b :: k). O2 (Mat s) a b => Mat s a (a b) Source #

inr :: forall (a :: k) (b :: k). O2 (Mat s) a b => Mat s b (a b) Source #

new :: forall (a :: k). Obj (Mat s) a => Mat s One a Source #

jam :: forall (a :: k). Obj (Mat s) a => Mat s (a a) a Source #

(▿) :: forall (a :: k) (b :: k) (c :: k). (Obj (Mat s) a, Obj (Mat s) b, Obj (Mat s) c) => Mat s b a -> Mat s c a -> Mat s (b c) a Source #

Ring s => Monoidal ((⊗) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (One :: Type -> Type) (Mat s :: (Type -> Type) -> (Type -> Type) -> Type) Source # 
Instance details

Defined in Algebra.Linear

Methods

(⊗) :: forall (a :: k) (b :: k) (c :: k) (d :: k). (Obj (Mat s) a, Obj (Mat s) b, Obj (Mat s) c, Obj (Mat s) d) => Mat s a b -> Mat s c d -> Mat s (a c) (b d) Source #

assoc :: forall (a :: k) (b :: k) (c :: k). (Obj (Mat s) a, Obj (Mat s) b, Obj (Mat s) c) => Mat s ((a b) c) (a (b c)) Source #

assoc_ :: forall (a :: k) (b :: k) (c :: k). (Obj (Mat s) a, Obj (Mat s) b, Obj (Mat s) c) => Mat s (a (b c)) ((a b) c) Source #

unitorR :: forall (a :: k). (Obj (Mat s) a, Obj (Mat s) One) => Mat s a (a One) Source #

unitorR_ :: forall (a :: k). (Obj (Mat s) a, Obj (Mat s) One) => Mat s (a One) a Source #

unitorL :: forall (a :: k). (Obj (Mat s) a, Obj (Mat s) One) => Mat s a (One a) Source #

unitorL_ :: forall (a :: k). (Obj (Mat s) a, Obj (Mat s) One) => Mat s (One a) a Source #

Ring s => Symmetric ((⊗) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (One :: Type -> Type) (Mat s :: (Type -> Type) -> (Type -> Type) -> Type) Source # 
Instance details

Defined in Algebra.Linear

Ring s => Braided ((∘) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Id (Mat s :: (Type -> Type) -> (Type -> Type) -> Type) Source # 
Instance details

Defined in Algebra.Linear

Methods

swap :: forall (a :: k) (b :: k). (Obj (Mat s) a, Obj (Mat s) b) => Mat s (a b) (b a) Source #

swap_ :: forall (a :: k) (b :: k). (Obj (Mat s) a, Obj (Mat s) b) => Mat s (a b) (b a) Source #

Ring s => Monoidal ((∘) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Id (Mat s :: (Type -> Type) -> (Type -> Type) -> Type) Source # 
Instance details

Defined in Algebra.Linear

Methods

(⊗) :: forall (a :: k) (b :: k) (c :: k) (d :: k). (Obj (Mat s) a, Obj (Mat s) b, Obj (Mat s) c, Obj (Mat s) d) => Mat s a b -> Mat s c d -> Mat s (a c) (b d) Source #

assoc :: forall (a :: k) (b :: k) (c :: k). (Obj (Mat s) a, Obj (Mat s) b, Obj (Mat s) c) => Mat s ((a b) c) (a (b c)) Source #

assoc_ :: forall (a :: k) (b :: k) (c :: k). (Obj (Mat s) a, Obj (Mat s) b, Obj (Mat s) c) => Mat s (a (b c)) ((a b) c) Source #

unitorR :: forall (a :: k). (Obj (Mat s) a, Obj (Mat s) Id) => Mat s a (a Id) Source #

unitorR_ :: forall (a :: k). (Obj (Mat s) a, Obj (Mat s) Id) => Mat s (a Id) a Source #

unitorL :: forall (a :: k). (Obj (Mat s) a, Obj (Mat s) Id) => Mat s a (Id a) Source #

unitorL_ :: forall (a :: k). (Obj (Mat s) a, Obj (Mat s) Id) => Mat s (Id a) a Source #

Ring s => Symmetric ((∘) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Id (Mat s :: (Type -> Type) -> (Type -> Type) -> Type) Source # 
Instance details

Defined in Algebra.Linear

Ring s => Category (Mat s :: (Type -> Type) -> (Type -> Type) -> Type) Source # 
Instance details

Defined in Algebra.Linear

Associated Types

type Obj (Mat s) :: k -> Constraint Source #

Methods

(.) :: forall (a :: k) (b :: k) (c :: k). (Obj (Mat s) a, Obj (Mat s) b, Obj (Mat s) c) => Mat s b c -> Mat s a b -> Mat s a c Source #

id :: forall (a :: k). Obj (Mat s) a => Mat s a a Source #

Ring s => Dagger (Mat s :: (Type -> Type) -> (Type -> Type) -> Type) Source # 
Instance details

Defined in Algebra.Linear

Methods

dagger :: forall (a :: k) (b :: k). O2 (Mat s) a b => Mat s a b -> Mat s b a Source #

(Arbitrary s, Arbitrary1 a, Arbitrary1 b) => Arbitrary (Mat s a b) Source # 
Instance details

Defined in Algebra.Linear

Methods

arbitrary :: Gen (Mat s a b) #

shrink :: Mat s a b -> [Mat s a b] #

Show (w (v s)) => Show (Mat s w v) Source # 
Instance details

Defined in Algebra.Linear

Methods

showsPrec :: Int -> Mat s w v -> ShowS #

show :: Mat s w v -> String #

showList :: [Mat s w v] -> ShowS #

(Applicative f, Applicative g, AbelianAdditive a) => AbelianAdditive (Mat a f g) Source # 
Instance details

Defined in Algebra.Linear

(Applicative f, Applicative g, Additive a) => Additive (Mat a f g) Source # 
Instance details

Defined in Algebra.Linear

Methods

(+) :: Mat a f g -> Mat a f g -> Mat a f g Source #

zero :: Mat a f g Source #

times :: Natural -> Mat a f g -> Mat a f g Source #

(Applicative f, Applicative g, Group a) => Group (Mat a f g) Source # 
Instance details

Defined in Algebra.Linear

Methods

(-) :: Mat a f g -> Mat a f g -> Mat a f g Source #

subtract :: Mat a f g -> Mat a f g -> Mat a f g Source #

negate :: Mat a f g -> Mat a f g Source #

mult :: Integer -> Mat a f g -> Mat a f g Source #

(TestEqual s, Arbitrary s, Arbitrary1 a, Arbitrary1 b, Show (a (b s)), VectorR b, VectorR a) => TestEqual (Mat s a b) Source # 
Instance details

Defined in Algebra.Linear

Methods

(=.=) :: Mat s a b -> Mat s a b -> Property Source #

type Obj (Mat s :: (Type -> Type) -> (Type -> Type) -> Type) Source # 
Instance details

Defined in Algebra.Linear

type Obj (Mat s :: (Type -> Type) -> (Type -> Type) -> Type) = VectorR

newtype Flat w v s Source #

View of the matrix as a composition of functors.

Constructors

Flat 

Fields

Instances

Instances details
(Foldable w, Foldable v) => Foldable (Flat w v) Source # 
Instance details

Defined in Algebra.Linear

Methods

fold :: Monoid m => Flat w v m -> m #

foldMap :: Monoid m => (a -> m) -> Flat w v a -> m #

foldMap' :: Monoid m => (a -> m) -> Flat w v a -> m #

foldr :: (a -> b -> b) -> b -> Flat w v a -> b #

foldr' :: (a -> b -> b) -> b -> Flat w v a -> b #

foldl :: (b -> a -> b) -> b -> Flat w v a -> b #

foldl' :: (b -> a -> b) -> b -> Flat w v a -> b #

foldr1 :: (a -> a -> a) -> Flat w v a -> a #

foldl1 :: (a -> a -> a) -> Flat w v a -> a #

toList :: Flat w v a -> [a] #

null :: Flat w v a -> Bool #

length :: Flat w v a -> Int #

elem :: Eq a => a -> Flat w v a -> Bool #

maximum :: Ord a => Flat w v a -> a #

minimum :: Ord a => Flat w v a -> a #

sum :: Num a => Flat w v a -> a #

product :: Num a => Flat w v a -> a #

(Applicative w, Applicative v) => Applicative (Flat w v) Source # 
Instance details

Defined in Algebra.Linear

Methods

pure :: a -> Flat w v a #

(<*>) :: Flat w v (a -> b) -> Flat w v a -> Flat w v b #

liftA2 :: (a -> b -> c) -> Flat w v a -> Flat w v b -> Flat w v c #

(*>) :: Flat w v a -> Flat w v b -> Flat w v b #

(<*) :: Flat w v a -> Flat w v b -> Flat w v a #

(Functor w, Functor v) => Functor (Flat w v) Source # 
Instance details

Defined in Algebra.Linear

Methods

fmap :: (a -> b) -> Flat w v a -> Flat w v b #

(<$) :: a -> Flat w v b -> Flat w v a #

Show (w (v s)) => Show (Flat w v s) Source # 
Instance details

Defined in Algebra.Linear

Methods

showsPrec :: Int -> Flat w v s -> ShowS #

show :: Flat w v s -> String #

showList :: [Flat w v s] -> ShowS #

flatMat :: Mat s w v -> Flat w v s Source #

matFlat :: Flat w v s -> Mat s w v Source #

fromRel :: (VectorR a, VectorR b) => Rel s (Rep a) (Rep b) -> Mat s a b Source #

type Mat3x3 s = SqMat V3 s Source #

type Mat2x2 s = SqMat V2 s Source #

pattern Mat2x2 :: forall s. s -> s -> s -> s -> Mat s V2 V2 Source #

pattern Mat3x3 :: forall s. s -> s -> s -> s -> s -> s -> s -> s -> s -> Mat s V3 V3 Source #

outerWith :: (Applicative v, Applicative w) => (s -> t -> u) -> w s -> v t -> Mat u v w Source #

outer :: (Applicative v, Applicative w, Multiplicative s) => Euclid w s -> Euclid v s -> Mat s (Euclid w) (Euclid v) Source #

Outer product

diagonal :: Eq (Rep v) => Representable v => Ring s => Applicative v => v s -> SqMat v s Source #

rotation3d :: Transcendental a => a -> V3 a -> Mat3x3 a Source #

3d rotation around given axis

rotationFromTo :: forall a. Algebraic a => V3 a -> V3 a -> Mat3x3 a Source #

3d rotation mapping the direction of from to that of to

transpose :: Functor f => Distributive g => Mat a f g -> Mat a g f Source #

Transposition as distribution

matMul :: (Foldable u, Ring s, Applicative w, Applicative v, Applicative u) => Mat s u w -> Mat s v u -> Mat s v w Source #

(<+>) :: (Applicative f, Additive b) => f b -> f b -> f b Source #

matVecMul :: forall s v w. (Ring s, Foldable v, Applicative v, Applicative w) => Mat s v w -> v s -> w s Source #