reactive-banana-0.8.0.3: Library for functional reactive programming (FRP).

Safe HaskellSafe-Inferred
LanguageHaskell98

Reactive.Banana.Model

Contents

Synopsis

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

type Event a = [Maybe a] Source

Basic

unionWith :: (a -> a -> a) -> Event a -> Event a -> Event a Source

mapE :: (a -> b) -> Event a -> Event b Source

accumE :: a -> Event (a -> a) -> Event a Source

applyE :: Behavior (a -> b) -> Event a -> Event b Source

stepperB :: a -> Event a -> Behavior a Source

applyB :: Behavior (a -> b) -> Behavior a -> Behavior b Source

mapB :: (a -> b) -> Behavior a -> Behavior b Source

Dynamic event switching

type Moment a = Time -> a Source

Interpretation

interpret :: (Event a -> Moment (Event b)) -> [Maybe a] -> [Maybe b] Source