observable-0.1.1: Make your action to be observable and listen events from them.

Safe HaskellSafe
LanguageHaskell2010

Control.Observable

Synopsis

Documentation

type Observable f a r = ContT r (Capture r f) a Source #

Capture used here as delimiter

(*=>) :: Monad f => f a -> (a -> f r) -> f r Source #

Looks like a bind, but it has another semantics

dispatch :: ContT r f a -> Observable f a r Source #

Make continuation to be observable

subscribe :: Applicative f => Observable f a r -> (a -> f r) -> f r Source #

Listen all event from action, forever

notify :: Observable f a r -> (a -> f r) -> f r Source #

Listen only first event, just once

obs :: Monad f => f a -> Observable f a r Source #

Make monadic action to be observable

bypass :: (Monad f, Traversable t) => t a -> (a -> f r) -> f (t r) Source #

Yield all a over some t with callback function