dunai-0.5.1: Generalised reactive framework supporting classic, arrowized and monadic FRP.

Safe HaskellNone
LanguageHaskell2010

Data.MonadicStreamFunction.Instances.VectorSpace

Contents

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 classes RModule and VectorSpace.

Orphan instances

(Monad m, VectorSpace v) => VectorSpace (MSF m a v) Source #

Vector-space instance for MSFs.

Instance details

Methods

(^/) :: MSF m a v -> Groundfield (MSF m a v) -> MSF m a v Source #

(Monad m, RModule v) => RModule (MSF m a v) Source #

R-module instance for MSFs.

Instance details

Associated Types

type Groundring (MSF m a v) :: Type Source #

Methods

zeroVector :: MSF m a v Source #

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

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

negateVector :: MSF m a v -> MSF m a v Source #

(^+^) :: MSF m a v -> MSF m a v -> MSF m a v Source #

(^-^) :: MSF m a v -> MSF m a v -> MSF m a v Source #