Safe Haskell | Safe-Inferred |
---|
- type Event a = [Maybe a]
- data Behavior a
- never :: Event a
- filterJust :: Event (Maybe a) -> Event a
- unionWith :: (a -> a -> a) -> Event a -> Event a -> Event a
- mapE :: (a -> b) -> Event a -> Event b
- accumE :: a -> Event (a -> a) -> Event a
- applyE :: Behavior (a -> b) -> Event a -> Event b
- stepperB :: a -> Event a -> Behavior a
- pureB :: a -> Behavior a
- applyB :: Behavior (a -> b) -> Behavior a -> Behavior b
- mapB :: (a -> b) -> Behavior a -> Behavior b
- type Moment a = Time -> a
- initialB :: Behavior a -> Moment a
- trimE :: Event a -> Moment (Moment (Event a))
- trimB :: Behavior a -> Moment (Moment (Behavior a))
- observeE :: Event (Moment a) -> Event a
- switchE :: Event (Moment (Event a)) -> Event a
- switchB :: Behavior a -> Event (Moment (Behavior a)) -> Behavior a
- interpret :: (Event a -> Moment (Event b)) -> [Maybe a] -> [Maybe b]
Synopsis
Model implementation of the abstract syntax tree.
Description
This module contains the model implementation for the primitive combinators defined Reactive.Banana.Internal.AST which in turn are the basis for the official combinators documented in Reactive.Banana.Combinators.
Look at the source code to make maximal use of this module. (If there is no link to the source code at every type signature, then you have to run cabal with --hyperlink-source flag.)
This model is authoritative: when observed with the interpretModel
function,
both the actual implementation and its model must agree on the result.
Note that this must also hold for recursive and partial definitions
(at least in spirit, I'm not going to split hairs over _|_
vs \_ -> _|_
).
Concerning time and space complexity, the model is not authoritative, however. Implementations are free to be much more efficient.
Combinators
Data types
Basic
filterJust :: Event (Maybe a) -> Event aSource