netwire-5.0.3: Functional reactive programming library

Copyright | (c) 2013 Ertugrul Soeylemez
License | BSD3
Maintainer | Ertugrul Soeylemez <es@ertes.de>
Safe Haskell | None
Language | Haskell2010

FRP.Netwire.Move

Contents

- Calculus

Description

Synopsis

- derivative :: forall a t s e (m :: Type -> Type). (RealFloat a, HasTime t s, Monoid e) => Wire s e m a a
- integral :: forall a t s e (m :: Type -> Type). (Fractional a, HasTime t s) => a -> Wire s e m a a
- integralWith :: forall a t s w e (m :: Type -> Type). (Fractional a, HasTime t s) => (w -> a -> a) -> a -> Wire s e m (a, w) a

# Calculus

derivative :: forall a t s e (m :: Type -> Type). (RealFloat a, HasTime t s, Monoid e) => Wire s e m a a Source #

Time derivative of the input signal.

- Depends: now.
- Inhibits: at singularities.

integral Source #

Arguments

:: forall a t s e (m :: Type -> Type). (Fractional a, HasTime t s) |
=> a | Integration constant (aka start value).
-> Wire s e m a a |

Integrate the input signal over time.

- Depends: before now.

integralWith Source #

Arguments

:: forall a t s w e (m :: Type -> Type). (Fractional a, HasTime t s) |
=> (w -> a -> a) | Correction function.
-> a | Integration constant (aka start value).
-> Wire s e m (a, w) a |

Integrate the left input signal over time, but apply the given correction function to it. This can be used to implement collision detection/reaction.

The right signal of type `w` is the world value. It is just passed to the correction function for reference and is not used otherwise.

The correction function must be idempotent with respect to the world value: `f w (f w x) = f w x`. This is necessary and sufficient to protect time continuity.

- Depends: before now.