Copyright | (c) Ivan Perez and Manuel Baerenz 2016 |
---|---|
License | BSD3 |
Maintainer | ivan.perez@keera.co.uk |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
VectorSpace
instances for MSF
s that produce vector spaces. This allows
you to use vector operators with MSF
s that output vectors, for example,
you can write:
msf1 :: MSF Input (Double, Double) -- defined however you want msf2 :: MSF Input (Double, Double) -- defined however you want msf3 :: MSF Input (Double, Double) msf3 = msf1 ^+^ msf2
instead of
msf3 = (msf1 &&& msf2) >>> arr (uncurry (^+^))
Instances are provided for the type class VectorSpace
.
Orphan instances
(Monad m, Eq s, Num s, VectorSpace v s, Floating (MSF m a s)) => VectorSpace (MSF m a v) (MSF m a s) Source # | Vector-space instance for |
zeroVector :: MSF m a v # (*^) :: MSF m a s -> MSF m a v -> MSF m a v # (^/) :: MSF m a v -> MSF m a s -> MSF m a v # (^+^) :: MSF m a v -> MSF m a v -> MSF m a v # (^-^) :: MSF m a v -> MSF m a v -> MSF m a v # negateVector :: MSF m a v -> MSF m a v # dot :: MSF m a v -> MSF m a v -> MSF m a s # |