| Safe Haskell | None |
|---|
Reactive.Banana.Switch
- data Moment t a
- data AnyMoment f a
- anyMoment :: (forall t. Moment t (f t a)) -> AnyMoment f a
- now :: AnyMoment f a -> forall t. Moment t (f t a)
- trimE :: Event t a -> Moment t (AnyMoment Event a)
- trimB :: Behavior t a -> Moment t (AnyMoment Behavior a)
- switchE :: forall t a. Event t (AnyMoment Event a) -> Event t a
- switchB :: forall t a. Behavior t a -> Event t (AnyMoment Behavior a) -> Behavior t a
- observeE :: Event t (AnyMoment Identity a) -> Event t a
- valueB :: Behavior t a -> Moment t a
- newtype Identity t a = Identity {
- getIdentity :: a
Synopsis
Dynamic event switching.
Moment monad
The Moment monad denotes a value at a particular moment in time.
This monad is not very interesting, it is mainly used for book-keeping.
In particular, the type parameter t is used
to disallow various unhealthy programs.
This monad is also used to describe event networks
in the Reactive.Banana.Frameworks module.
This only happens when the type parameter t
is constrained by the Frameworks class.
To be precise, an expression of type Moment t a denotes
a value of type a that is observed at a moment in time
which is indicated by the type parameter t.
Value present at any/every moment in time.
Dynamic event switching
trimB :: Behavior t a -> Moment t (AnyMoment Behavior a)Source
Trim a Behavior to a variable start time.
switchE :: forall t a. Event t (AnyMoment Event a) -> Event t aSource
Dynamically switch between Event.
switchB :: forall t a. Behavior t a -> Event t (AnyMoment Behavior a) -> Behavior t aSource
Dynamically switch between Behavior.
observeE :: Event t (AnyMoment Identity a) -> Event t aSource
Observe a value at those moments in time where event occurrences happen.