Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data Change a
- class Monad m => MonadChange m where
- runChange :: Change a -> (a, Bool)
- type Updater a = a -> Change a
- sharing :: Updater a -> Updater a
- runUpdater :: Updater a -> a -> (a, Bool)
- dirty :: Updater a
- ifDirty :: MonadChange m => m a -> (a -> m b) -> (a -> m b) -> m b
- class Traversable f => Updater1 f where
- class Updater2 f where
Documentation
The Change
monad.
class Monad m => MonadChange m where Source #
The class of change monads.
MonadChange Identity Source # | A mock change monad. |
MonadChange Change Source # | |
runChange :: Change a -> (a, Bool) Source #
Run a Change
computation, returning result plus change flag.
sharing :: Updater a -> Updater 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 :: 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.