dunai-0.8.3: Generalised reactive framework supporting classic, arrowized and monadic FRP.
Copyright(c) Ivan Perez and Manuel Baerenz 2016
LicenseBSD3
Maintainerivan.perez@keera.co.uk
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.MonadicStreamFunction.Instances.VectorSpace

Description

VectorSpace instances for MSFs that produce vector spaces. This allows you to use vector operators with MSFs 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, VectorSpace v s) => VectorSpace (MSF m a v) s Source #

Vector-space instance for MSFs.

Instance details

Methods

zeroVector :: MSF m a v #

(*^) :: s -> MSF m a v -> MSF m a v #

(^/) :: MSF m a v -> 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 -> s #

norm :: MSF m a v -> s #

normalize :: MSF m a v -> MSF m a v #