observable-0.1.5: Continuation patterns

Safe HaskellSafe
LanguageHaskell2010

Control.Observable

Synopsis

Documentation

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

Capture used here as limiter of continuation

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

Make continuation to be observable

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

Make monadic action to be observable

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

Listen only first event, call back just once

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

Listen only first event, call back forever

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

Listen all events from action, call back just once

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

Listen all events from action, call back forever

(.:~.) :: Observable f a r -> (a -> f r) -> f r Source #

Infix version of notify

(.:~*) :: Applicative f => Observable f a r -> (a -> f r) -> f r Source #

Infix version of follow

(*:~.) :: Applicative f => Observable f a r -> (a -> f r) -> f r Source #

Infix version of subscribe

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

Infix version of watch