Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Vector spaces as zippable functors
Synopsis
- type Zeroable = Pointed
- zeroV :: (Pointed f, Num a) => f a
- scaleV :: (Functor f, Num s) => s -> f s -> f s
- (*^) :: (Functor f, Num s) => s -> f s -> f s
- negateV :: (Functor f, Num s) => f s -> f s
- addV :: (Zip f, Num s) => f s -> f s -> f s
- (^+^) :: (Zip f, Num s) => f s -> f s -> f s
- subV :: (Zip f, Num s) => f s -> f s -> f s
- (^-^) :: (Zip f, Num s) => f s -> f s -> f s
- dotV :: forall s f. (Zip f, Foldable f, Num s) => f s -> f s -> s
- (<.>) :: forall s f. (Zip f, Foldable f, Num s) => f s -> f s -> s
- normSqr :: forall s f. (Functor f, Foldable f, Num s) => f s -> s
- distSqr :: forall s f. (Zip f, Foldable f, Num s) => f s -> f s -> s
- outerV :: (Num s, Functor f, Functor g) => g s -> f s -> g (f s)
- (>.<) :: (Num s, Functor f, Functor g) => g s -> f s -> g (f s)
- normalizeV :: (Functor f, Foldable f, Floating a) => f a -> f a
- data SumV f a = SumV (f a)
- sumV :: (Functor m, Foldable m, Zeroable n, Zip n, Num a) => m (n a) -> n a
- type RepHasV s a = (HasRep a, HasV s (Rep a), V s a ~ V s (Rep a))
- class HasV s a where
- inV :: forall s a b. (HasV s a, HasV s b) => (a -> b) -> V s a s -> V s b s
- onV :: forall s a b. (HasV s a, HasV s b) => (V s a s -> V s b s) -> a -> b
- onV2 :: forall s a b c. (HasV s a, HasV s b, HasV s c) => (V s a s -> V s b s -> V s c s) -> a -> b -> c
- type IsScalar s = (HasV s s, V s s ~ Par1)
- class VComp h where
Documentation
normalizeV :: (Functor f, Foldable f, Floating a) => f a -> f a Source #
Normalize a vector (scale to unit magnitude)
SumV (f a) |
Nothing
Instances
HasV Double Double Source # | |
HasV Float Float Source # | |
HasV s () Source # | |
OpCon (:*) (Sat (HasV s) :: Type -> Type) Source # | |
HasV s a => HasV s (Product a) Source # | |
HasV s a => HasV s (Sum a) Source # | |
HasV s a => HasV s (Par1 a) Source # | |
HasV s a => HasV s (Pair a) Source # | |
HasV s (U1 a) Source # | |
(HasV s a, HasV s b) => HasV s (a :* b) Source # | |
(HasV s a, HasV s b) => HasV s (a :+ b) Source # | |
HasV s (f a) => HasV s (SumV f a) Source # | |
(HasV s b, KnownNat n) => HasV s (Vector n b) Source # | |
HasV s b => HasV s (a -> b) Source # | |
HasV s (Rep (L s a b)) => HasV s (L s a b) Source # | |
(HasV s a, HasV s b, HasV s c) => HasV s (a, b, c) Source # | |
(HasV s (f a), HasV s (g a)) => HasV s ((f :*: g) a) Source # | |
(HasV s a, HasV s b, HasV s c, HasV s d) => HasV s (a, b, c, d) Source # | |
HasV s (g (f a)) => HasV s ((g :.: f) a) Source # | |