dunai-0.11.2: 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.Num

Description

Number instances for MSFs that produce numbers. This allows you to use numeric operators with MSFs that output numbers, for example, you can write:

msf1 :: MSF Input Double -- defined however you want
msf2 :: MSF Input Double -- defined however you want
msf3 :: MSF Input Double
msf3 = msf1 + msf2

instead of

msf3 = (msf1 &&& msf2) >>> arr (uncurry (+))

Instances are provided for the type classes Num, Fractional and Floating.

Orphan instances

(Monad m, Floating b) => Floating (MSF m a b) Source #

Floating instance for MSFs.

Instance details

Methods

pi :: MSF m a b #

exp :: MSF m a b -> MSF m a b #

log :: MSF m a b -> MSF m a b #

sqrt :: MSF m a b -> MSF m a b #

(**) :: MSF m a b -> MSF m a b -> MSF m a b #

logBase :: MSF m a b -> MSF m a b -> MSF m a b #

sin :: MSF m a b -> MSF m a b #

cos :: MSF m a b -> MSF m a b #

tan :: MSF m a b -> MSF m a b #

asin :: MSF m a b -> MSF m a b #

acos :: MSF m a b -> MSF m a b #

atan :: MSF m a b -> MSF m a b #

sinh :: MSF m a b -> MSF m a b #

cosh :: MSF m a b -> MSF m a b #

tanh :: MSF m a b -> MSF m a b #

asinh :: MSF m a b -> MSF m a b #

acosh :: MSF m a b -> MSF m a b #

atanh :: MSF m a b -> MSF m a b #

log1p :: MSF m a b -> MSF m a b #

expm1 :: MSF m a b -> MSF m a b #

log1pexp :: MSF m a b -> MSF m a b #

log1mexp :: MSF m a b -> MSF m a b #

(Monad m, Num b) => Num (MSF m a b) Source #

Num instance for MSFs.

Instance details

Methods

(+) :: MSF m a b -> MSF m a b -> MSF m a b #

(-) :: MSF m a b -> MSF m a b -> MSF m a b #

(*) :: MSF m a b -> MSF m a b -> MSF m a b #

negate :: MSF m a b -> MSF m a b #

abs :: MSF m a b -> MSF m a b #

signum :: MSF m a b -> MSF m a b #

fromInteger :: Integer -> MSF m a b #

(Monad m, Fractional b) => Fractional (MSF m a b) Source #

Fractional instance for MSFs.

Instance details

Methods

(/) :: MSF m a b -> MSF m a b -> MSF m a b #

recip :: MSF m a b -> MSF m a b #

fromRational :: Rational -> MSF m a b #