-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Continuation patterns
--
-- Make your actions to be observable and handle events from them.
@package observable
@version 0.1.5
module Control.Observable
-- | Capture used here as limiter of continuation
type Observable f a r = ContT r (Capture r f) a
-- | Make continuation to be observable
dispatch :: ContT r f a -> Observable f a r
-- | Make monadic action to be observable
obs :: Monad f => f a -> Observable f a r
-- | Listen only first event, call back just once
notify :: Observable f a r -> (a -> f r) -> f r
-- | Listen only first event, call back forever
follow :: Applicative f => Observable f a r -> (a -> f r) -> f r
-- | Listen all events from action, call back just once
subscribe :: Applicative f => Observable f a r -> (a -> f r) -> f r
-- | Listen all events from action, call back forever
watch :: Applicative f => Observable f a r -> (a -> f r) -> f r
-- | Infix version of notify
(.:~.) :: Observable f a r -> (a -> f r) -> f r
-- | Infix version of follow
(.:~*) :: Applicative f => Observable f a r -> (a -> f r) -> f r
-- | Infix version of subscribe
(*:~.) :: Applicative f => Observable f a r -> (a -> f r) -> f r
-- | Infix version of watch
(*:~*) :: Applicative f => Observable f a r -> (a -> f r) -> f r