Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data ChangeT m a
- runChangeT :: Functor m => ChangeT m a -> m (a, Bool)
- mapChangeT :: (m (a, Any) -> n (b, Any)) -> ChangeT m a -> ChangeT n b
- type UpdaterT m a = a -> ChangeT m a
- runUpdaterT :: Functor m => UpdaterT m a -> a -> m (a, Bool)
- type Change a = ChangeT Identity a
- class Monad m => MonadChange m where
- tellDirty :: m ()
- listenDirty :: m a -> m (a, Bool)
- runChange :: Change a -> (a, Bool)
- type Updater a = UpdaterT Identity a
- sharing :: Monad m => UpdaterT m a -> UpdaterT m a
- runUpdater :: Updater a -> a -> (a, Bool)
- dirty :: Monad m => UpdaterT m a
- ifDirty :: (Monad m, MonadChange m) => m a -> (a -> m b) -> (a -> m b) -> m b
- class Traversable f => Updater1 f where
- class Updater2 f where
Documentation
The ChangeT
monad transformer.
Instances
runChangeT :: Functor m => ChangeT m a -> m (a, Bool) Source #
Run a ChangeT
computation, returning result plus change flag.
mapChangeT :: (m (a, Any) -> n (b, Any)) -> ChangeT m a -> ChangeT n b Source #
Map a ChangeT
computation (monad transformer action).
class Monad m => MonadChange m where Source #
The class of change monads.
:: m () | Mark computation as having changed something. |
listenDirty :: m a -> m (a, Bool) Source #
Instances
MonadChange Identity Source # | A mock change monad. Always assume change has happened. |
Monad m => MonadChange (ChangeT m) Source # | |
Monad m => MonadChange (IdentityT m) Source # | |
runChange :: Change a -> (a, Bool) Source #
Run a Change
computation, returning result plus change flag.
sharing :: Monad m => UpdaterT m a -> UpdaterT m a Source #
Replace result of updating with original input if nothing has changed.
runUpdater :: Updater a -> a -> (a, Bool) Source #
Blindly run an updater.
ifDirty :: (Monad m, MonadChange m) => m a -> (a -> m b) -> (a -> m b) -> m b Source #
class Traversable f => Updater1 f where Source #
Like Functor
, but preserving sharing.
Nothing
class Updater2 f where Source #
Like Bifunctor
, but preserving sharing.
updater2 :: Updater a -> Updater b -> Updater (f a b) Source #
updates2 :: Updater a -> Updater b -> Updater (f a b) Source #
update2 :: Updater a -> Updater b -> EndoFun (f a b) Source #