box-0.0.1.5: boxes

Safe HaskellNone
LanguageHaskell2010

Box.Updater

Description

Synopsis

Documentation

data Updater a Source #

An updater of a value a, where the updating process consists of an IO fold over an emitter

Constructors

Updater (FoldM IO e a) (Cont IO (Emitter STM e)) 
Instances
Functor Updater Source # 
Instance details

Defined in Box.Updater

Methods

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

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

Applicative Updater Source # 
Instance details

Defined in Box.Updater

Methods

pure :: a -> Updater a #

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

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

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

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

updater :: Fold e a -> Cont IO (Emitter STM e) -> Updater a Source #

Create an Updatable value using a pure Fold

listen :: (a -> IO ()) -> Updater a -> Updater a Source #

run an action on each update > listen mempty = id > > listen (f <> g) = listen g . listen f