reactive-banana-bunch-1.0.0.1: Extend reactive-banana to multiple events per time point

Safe HaskellNone
LanguageHaskell98

Reactive.Banana.Bunch.Frameworks

Synopsis

Documentation

data MomentIO a #

The MomentIO monad is used to add inputs and outputs to an event network.

Instances
Monad MomentIO 
Instance details

Defined in Reactive.Banana.Types

Methods

(>>=) :: MomentIO a -> (a -> MomentIO b) -> MomentIO b #

(>>) :: MomentIO a -> MomentIO b -> MomentIO b #

return :: a -> MomentIO a #

fail :: String -> MomentIO a #

Functor MomentIO 
Instance details

Defined in Reactive.Banana.Types

Methods

fmap :: (a -> b) -> MomentIO a -> MomentIO b #

(<$) :: a -> MomentIO b -> MomentIO a #

MonadFix MomentIO 
Instance details

Defined in Reactive.Banana.Types

Methods

mfix :: (a -> MomentIO a) -> MomentIO a #

Applicative MomentIO 
Instance details

Defined in Reactive.Banana.Types

Methods

pure :: a -> MomentIO a #

(<*>) :: MomentIO (a -> b) -> MomentIO a -> MomentIO b #

liftA2 :: (a -> b -> c) -> MomentIO a -> MomentIO b -> MomentIO c #

(*>) :: MomentIO a -> MomentIO b -> MomentIO b #

(<*) :: MomentIO a -> MomentIO b -> MomentIO a #

MonadIO MomentIO 
Instance details

Defined in Reactive.Banana.Types

Methods

liftIO :: IO a -> MomentIO a #

MonadMoment MomentIO 
Instance details

Defined in Reactive.Banana.Types

Methods

liftMoment :: Moment a -> MomentIO a #

type Handler a = a -> IO () #

An event handler is a function that takes an event value and performs some computation.

data Future a #

The Future monad is just a helper type for the changes function.

A value of type Future a is only available in the context of a reactimate but not during event processing.

Instances
Monad Future 
Instance details

Defined in Reactive.Banana.Types

Methods

(>>=) :: Future a -> (a -> Future b) -> Future b #

(>>) :: Future a -> Future b -> Future b #

return :: a -> Future a #

fail :: String -> Future a #

Functor Future 
Instance details

Defined in Reactive.Banana.Types

Methods

fmap :: (a -> b) -> Future a -> Future b #

(<$) :: a -> Future b -> Future a #

Applicative Future 
Instance details

Defined in Reactive.Banana.Types

Methods

pure :: a -> Future a #

(<*>) :: Future (a -> b) -> Future a -> Future b #

liftA2 :: (a -> b -> c) -> Future a -> Future b -> Future c #

(*>) :: Future a -> Future b -> Future b #

(<*) :: Future a -> Future b -> Future a #

compile :: MomentIO () -> IO EventNetwork #

Compile the description of an event network into an EventNetwork that you can actuate, pause and so on.

actuate :: EventNetwork -> IO () #

Actuate an event network. The inputs will register their event handlers, so that the networks starts to produce outputs in response to input events.

pause :: EventNetwork -> IO () #

Pause an event network. Immediately stop producing output. (In a future version, it will also unregister all event handlers for inputs.) Hence, the network stops responding to input events, but it's state will be preserved.

You can resume the network with actuate.

Note: You can stop a network even while it is processing events, i.e. you can use pause as an argument to reactimate. The network will not stop immediately though, only after the current event has been processed completely.

liftIO :: MonadIO m => IO a -> m a #

Lift a computation from the IO monad.

plainChanges :: Behavior a -> MomentIO (Event a) Source #

This is a bit of a hack. The events will occur slightly after the behavior changes.