rsagl-frp- The RogueStar Animation and Graphics Library: Functional Reactive Programming




delay :: x -> FRP e m x xSource

Delay a piece of data for one frame.

integral :: (AbstractVector v, AbstractAdd p v) => p -> FRP e m (Rate v) pSource

Take the integral of a rate over time, using the trapezoidal rule.

derivative :: (AbstractVector v, AbstractSubtract p v) => FRP e m p (Rate v)Source

Take the derivative of a value over time, by simple subtraction between frames.

accumulateNumerical :: Frequency -> (i -> o -> Time -> Time -> Integer -> o) -> o -> FRP e m i oSource

accumulate harness for some numerical methods. Parameters are: current input, previous output, delta time, absolute time, and number of frames at the specified frequency.

integralRK4 :: AbstractVector v => Frequency -> (p -> v -> p) -> p -> FRP e m (Time -> p -> Rate v) pSource

integralRK4' :: AbstractVector v => Frequency -> (p -> v -> p) -> (p, Rate v) -> FRP e m (Time -> p -> Rate v -> Acceleration v) (p, Rate v)Source

summation :: AbstractAdd p v => p -> FRP e m v pSource

Sum some data frame-by-frame.

threadTime :: FRP e m () TimeSource

Elapsed time since the instantiation of this switch or thread. Reset when a thread switches.

sticky :: (x -> Bool) -> x -> FRP e m x xSource

Answer the most recent input that satisfies the predicate. Accepts an initial value, which need not itself satisfy the predicate.

This can be a performance optimization, if it prevents unecessary evaluation of an input.

initial :: FRP e m x xSource

Answer the first input that ever passes through a function.

data EdgeDetectionMode Source

The edge detection mode. If Discrete, detect edge between subsequent frames only. If Fuzzy detect edge since the most recent previous detected edge. If HashedDiscrete, the comparison function is itself expensive, and the FRP runtime will compare by StableNames as a short-circuit optimization.



edge :: EdgeDetectionMode -> (x -> x -> Bool) -> FRP e m x BoolSource

Returns True only during frames on which the input has changed, based on a user-specified equality predicate. The predicate function takes the most recent input as its first parameter.

changed :: (x -> x -> Bool) -> FRP e m x BoolSource

Same as 'edge Discrete'.

clingy :: EdgeDetectionMode -> (j -> j -> Bool) -> (j -> p) -> FRP e m j pSource

Recalculate a function only at the edges of it's input.