Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data ChangeT (m :: Type -> Type) 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 :: Type -> Type) 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 :: Type -> Type) where
- tellDirty :: m ()
- listenDirty :: m a -> m (a, Bool)
- runChange :: Change a -> (a, Bool)
- type Updater a = UpdaterT Identity a
- sharing :: forall (m :: Type -> Type) a. Monad m => UpdaterT m a -> UpdaterT m a
- runUpdater :: Updater a -> a -> (a, Bool)
- dirty :: forall (m :: Type -> Type) a. 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 :: Type -> Type) where
- class Updater2 (f :: Type -> Type -> Type) where
Documentation
data ChangeT (m :: Type -> Type) a Source #
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).
runUpdaterT :: Functor m => UpdaterT m a -> a -> m (a, Bool) Source #
Blindly run an updater.
class Monad m => MonadChange (m :: Type -> Type) 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. |
Defined in Agda.Utils.Update | |
Monad m => MonadChange (ChangeT m) Source # | |
Defined in Agda.Utils.Update | |
Monad m => MonadChange (IdentityT m) Source # | |
Defined in Agda.Utils.Update |
runChange :: Change a -> (a, Bool) Source #
Run a Change
computation, returning result plus change flag.
sharing :: forall (m :: Type -> Type) a. 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 :: Type -> Type) where Source #
Like Functor
, but preserving sharing.
Nothing
class Updater2 (f :: Type -> Type -> Type) 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 #