Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data VZero a = VZero
- data VNext v a = VNext !(v a) !a
- type V1' = VNext VZero
- type V2' = VNext V1'
- type V3' = VNext V2'
- pattern V1' :: a -> V1' a
- pattern V2' :: forall a. a -> a -> V2' a
- pattern V3' :: forall a. a -> a -> a -> V3' a
- newtype Euclid f a = Euclid {
- fromEuclid :: f a
- type V3 = Euclid V3'
- type V2 = Euclid V2'
- pattern V2 :: forall a. a -> a -> Euclid V2' a
- pattern V3 :: forall a. a -> a -> a -> Euclid V3' a
- pureMat :: (Applicative v, Applicative w) => s -> Mat s v w
- (>*<) :: (Applicative v, Applicative w) => Mat (a -> s) v w -> Mat a v w -> Mat s v w
- (>$<) :: (Applicative v, Applicative w) => (a -> s) -> Mat a v w -> Mat s v w
- class VectorSpace (Scalar v) v => InnerProdSpace v where
- (⊙) :: Applicative v => Multiplicative s => v s -> v s -> v s
- (·) :: InnerProdSpace v => v -> v -> Scalar v
- sqNorm :: InnerProdSpace v => v -> Scalar v
- norm :: InnerProdSpace v => Floating (Scalar v) => v -> Scalar v
- normalize :: Floating (Scalar v) => InnerProdSpace v => v -> v
- (×) :: Ring a => V3 a -> V3 a -> V3 a
- index :: Applicative v => Traversable v => v Int
- type SqMat v s = Mat s v v
- newtype Mat s w v = Mat {
- fromMat :: v (w s)
- type Mat3x3 s = SqMat V3' s
- type Mat2x2 s = SqMat V2' s
- pattern Mat2x2 :: forall s. s -> s -> s -> s -> Mat s V2' V2'
- pattern Mat3x3 :: forall s. s -> s -> s -> s -> s -> s -> s -> s -> s -> Mat s V3' V3'
- matVecMul :: (Foldable f1, Ring b, Applicative f1, Functor f2) => Mat b f1 f2 -> Euclid f1 b -> Euclid f2 b
- rotation2d :: Floating a => a -> Mat2x2 a
- crossProductMatrix :: Group a => V3 a -> Mat3x3 a
- (⊗) :: (Applicative v, Applicative w, Multiplicative s) => Euclid w s -> Euclid v s -> Mat s w v
- tensorWith :: (Applicative v, Applicative w) => (s -> t -> u) -> w s -> v t -> Mat u v w
- identity :: Traversable v => Ring s => Applicative v => SqMat v s
- diagonal :: Traversable v => Ring s => Applicative v => Euclid v s -> SqMat v s
- rotation3d :: Ring a => Floating a => a -> V3 a -> Mat3x3 a
- rotationFromTo :: (Floating a, Module a a, Field a) => V3 a -> V3 a -> Mat3x3 a
- transpose :: Applicative f => Traversable g => Mat a f g -> Mat a g f
- matMul' :: (Traversable u, Ring s, Applicative w, Applicative v, Applicative u) => Mat s v u -> Mat s u w -> Mat s v w
- matMul :: (Traversable u, Ring s, Applicative w, Applicative v, Applicative u) => Mat s u w -> Mat s v u -> Mat s v w
- newtype OrthoMat v s = OrthoMat (SqMat v s)
Documentation
Instances
Functor (VZero :: Type -> Type) Source # | |
Applicative (VZero :: Type -> Type) Source # | |
Foldable (VZero :: Type -> Type) Source # | |
Defined in Algebra.Linear fold :: Monoid m => VZero m -> m # foldMap :: Monoid m => (a -> m) -> VZero a -> m # foldr :: (a -> b -> b) -> b -> VZero a -> b # foldr' :: (a -> b -> b) -> b -> VZero a -> b # foldl :: (b -> a -> b) -> b -> VZero a -> b # foldl' :: (b -> a -> b) -> b -> VZero a -> b # foldr1 :: (a -> a -> a) -> VZero a -> a # foldl1 :: (a -> a -> a) -> VZero a -> a # elem :: Eq a => a -> VZero a -> Bool # maximum :: Ord a => VZero a -> a # minimum :: Ord a => VZero a -> a # | |
Traversable (VZero :: Type -> Type) Source # | |
Eq (VZero a) Source # | |
Ord (VZero a) Source # | |
Show (VZero a) Source # | |
VNext !(v a) !a |
Instances
Functor v => Functor (VNext v) Source # | |
Applicative v => Applicative (VNext v) Source # | |
Foldable v => Foldable (VNext v) Source # | |
Defined in Algebra.Linear fold :: Monoid m => VNext v m -> 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 # elem :: Eq a => a -> VNext v a -> Bool # maximum :: Ord a => VNext v a -> a # minimum :: Ord a => VNext v a -> a # | |
Traversable v => Traversable (VNext v) Source # | |
(Eq a, Eq (v a)) => Eq (VNext v a) Source # | |
(Ord a, Ord (v a)) => Ord (VNext v a) Source # | |
Defined in Algebra.Linear | |
(Show a, Show (v a)) => Show (VNext v a) Source # | |
Make a Euclidean vector out of a traversable functor
Euclid | |
|
Instances
pureMat :: (Applicative v, Applicative w) => s -> Mat s v w Source #
(>*<) :: (Applicative v, Applicative w) => Mat (a -> s) v w -> Mat a v w -> Mat s v w Source #
(>$<) :: (Applicative v, Applicative w) => (a -> s) -> Mat a v w -> Mat s v w Source #
class VectorSpace (Scalar v) v => InnerProdSpace v where Source #
(⊙) :: Applicative v => Multiplicative s => v s -> v s -> v s Source #
(·) :: InnerProdSpace v => v -> v -> Scalar v Source #
sqNorm :: InnerProdSpace v => v -> Scalar v Source #
(×) :: Ring a => V3 a -> V3 a -> V3 a Source #
Cross product https://en.wikipedia.org/wiki/Cross_product
index :: Applicative v => Traversable v => v Int Source #
Instances
(Applicative f, Applicative g, Module s a) => Module s (Mat a f g) Source # | |
Ring s => Category (Mat s :: (Type -> Type) -> (Type -> Type) -> Type) Source # | |
Show (v (w s)) => Show (Mat s w v) Source # | |
(Applicative f, Applicative g, Group a) => Group (Mat a f g) Source # | |
(Applicative f, Applicative g, AbelianAdditive a) => AbelianAdditive (Mat a f g) Source # | |
Defined in Algebra.Linear | |
(Applicative f, Applicative g, Additive a) => Additive (Mat a f g) Source # | |
matVecMul :: (Foldable f1, Ring b, Applicative f1, Functor f2) => Mat b f1 f2 -> Euclid f1 b -> Euclid f2 b Source #
rotation2d :: Floating a => a -> Mat2x2 a Source #
(⊗) :: (Applicative v, Applicative w, Multiplicative s) => Euclid w s -> Euclid v s -> Mat s w v Source #
Tensor product
tensorWith :: (Applicative v, Applicative w) => (s -> t -> u) -> w s -> v t -> Mat u v w Source #
identity :: Traversable v => Ring s => Applicative v => SqMat v s Source #
diagonal :: Traversable v => Ring s => Applicative v => Euclid v s -> SqMat v s Source #
transpose :: Applicative f => Traversable g => Mat a f g -> Mat a g f Source #
matMul' :: (Traversable u, Ring s, Applicative w, Applicative v, Applicative u) => Mat s v u -> Mat s u w -> Mat s v w Source #
matMul :: (Traversable u, Ring s, Applicative w, Applicative v, Applicative u) => Mat s u w -> Mat s v u -> Mat s v w Source #
Instances
(Ring s, Applicative v, Traversable v) => Division (OrthoMat v s) Source # | |
(Ring s, Applicative v, Traversable v) => Multiplicative (OrthoMat v s) Source # | |