DysFRP-0.1: dysFunctional Reactive Programming

Safe HaskellSafe-Infered

Control.DysFRP

Synopsis

Documentation

data Event a Source

Discrete events.

Instances

type BehaviorGen a = Behavior (Behavior a)Source

Time functions with an additional time parameter, corresponding to a starting point.

runBehavior :: Behavior b -> IO bSource

Gets the current value of the Behavior.

mkE :: IO (a -> IO (), Event a)Source

Creates a new Event. Calling the returned action fires the event.

utcTimeB :: Behavior UTCTimeSource

A behavior which gives the current time.

elapsedTimeB :: BehaviorGen NominalDiffTimeSource

A BehaviorGen which gives the time from the starting point, in seconds.

elapsedTimeNumB :: Fractional a => BehaviorGen aSource

A BehaviorGen which gives the time from the starting point, in seconds.

dswitchB :: Behavior a -> Event (a -> Behavior a) -> BehaviorGen aSource

A BehaviorGen which mirrors the given Behavior from the starting point, and switches to the new behaviors (parametrized by the last value before the switch) given by the Event.

switchB :: Behavior a -> Event (Behavior a) -> BehaviorGen aSource

A specialization of dswitchB.

constB :: a -> Behavior aSource

A constant Behavior.

accumB :: a -> Event (a -> a) -> BehaviorGen aSource

genIntegralB :: (Num t, Num a, Num b) => ((t, a) -> (t, a) -> b -> b) -> Event x -> Behavior t -> b -> Behavior a -> BehaviorGen bSource

snapshotWithE :: (b -> a -> c) -> Behavior a -> Event b -> Event cSource

filterE :: (a -> Bool) -> Event a -> Event aSource

whenCondE :: Behavior a -> (a -> Bool) -> Event b -> Event aSource

constE :: a -> Event b -> Event aSource

genToE :: (a -> BehaviorGen b) -> Event a -> Event (Behavior b)Source

condChangeE :: Eq a => (a -> a -> Bool) -> a -> Behavior a -> Event b -> Behavior (Event a)Source

changeE :: Eq a => a -> Behavior a -> Event b -> Behavior (Event a)Source