Agda-2.6.3.20230805: A dependently typed functional programming language and proof assistant
Safe HaskellSafe-Inferred
LanguageHaskell2010

Agda.Utils.Update

Synopsis

Documentation

data ChangeT m a Source #

The ChangeT monad transformer.

Instances

Instances details
MonadTransControl ChangeT Source # 
Instance details

Defined in Agda.Utils.Update

Associated Types

type StT ChangeT a

Methods

liftWith :: Monad m => (Run ChangeT -> m a) -> ChangeT m a

restoreT :: Monad m => m (StT ChangeT a) -> ChangeT m a

MonadTrans ChangeT Source # 
Instance details

Defined in Agda.Utils.Update

Methods

lift :: Monad m => m a -> ChangeT m a #

HasOptions m => HasOptions (ChangeT m) Source # 
Instance details

Defined in Agda.Interaction.Options.HasOptions

MonadReduce m => MonadReduce (ChangeT m) Source # 
Instance details

Defined in Agda.TypeChecking.Monad.Base

Methods

liftReduce :: ReduceM a -> ChangeT m a Source #

MonadTCEnv m => MonadTCEnv (ChangeT m) Source # 
Instance details

Defined in Agda.TypeChecking.Monad.Base

Methods

askTC :: ChangeT m TCEnv Source #

localTC :: (TCEnv -> TCEnv) -> ChangeT m a -> ChangeT m a Source #

MonadTCM tcm => MonadTCM (ChangeT tcm) Source # 
Instance details

Defined in Agda.TypeChecking.Monad.Base

Methods

liftTCM :: TCM a -> ChangeT tcm a Source #

MonadTCState m => MonadTCState (ChangeT m) Source # 
Instance details

Defined in Agda.TypeChecking.Monad.Base

ReadTCState m => ReadTCState (ChangeT m) Source # 
Instance details

Defined in Agda.TypeChecking.Monad.Base

HasBuiltins m => HasBuiltins (ChangeT m) Source # 
Instance details

Defined in Agda.TypeChecking.Monad.Builtin

MonadAddContext m => MonadAddContext (ChangeT m) Source # 
Instance details

Defined in Agda.TypeChecking.Monad.Context

MonadDebug m => MonadDebug (ChangeT m) Source # 
Instance details

Defined in Agda.TypeChecking.Monad.Debug

PureTCM m => PureTCM (ChangeT m) Source # 
Instance details

Defined in Agda.TypeChecking.Monad.Pure

HasConstInfo m => HasConstInfo (ChangeT m) Source # 
Instance details

Defined in Agda.TypeChecking.Monad.Signature

Monad m => MonadChange (ChangeT m) Source # 
Instance details

Defined in Agda.Utils.Update

Methods

tellDirty :: ChangeT m () Source #

listenDirty :: ChangeT m a -> ChangeT m (a, Bool) Source #

MonadFail m => MonadFail (ChangeT m) Source # 
Instance details

Defined in Agda.Utils.Update

Methods

fail :: String -> ChangeT m a #

MonadIO m => MonadIO (ChangeT m) Source # 
Instance details

Defined in Agda.Utils.Update

Methods

liftIO :: IO a -> ChangeT m a #

Applicative m => Applicative (ChangeT m) Source # 
Instance details

Defined in Agda.Utils.Update

Methods

pure :: a -> ChangeT m a #

(<*>) :: ChangeT m (a -> b) -> ChangeT m a -> ChangeT m b #

liftA2 :: (a -> b -> c) -> ChangeT m a -> ChangeT m b -> ChangeT m c #

(*>) :: ChangeT m a -> ChangeT m b -> ChangeT m b #

(<*) :: ChangeT m a -> ChangeT m b -> ChangeT m a #

Functor m => Functor (ChangeT m) Source # 
Instance details

Defined in Agda.Utils.Update

Methods

fmap :: (a -> b) -> ChangeT m a -> ChangeT m b #

(<$) :: a -> ChangeT m b -> ChangeT m a #

Monad m => Monad (ChangeT m) Source # 
Instance details

Defined in Agda.Utils.Update

Methods

(>>=) :: ChangeT m a -> (a -> ChangeT m b) -> ChangeT m b #

(>>) :: ChangeT m a -> ChangeT m b -> ChangeT m b #

return :: a -> ChangeT m a #

type StT ChangeT a Source # 
Instance details

Defined in Agda.Utils.Update

type StT ChangeT a = (a, Any)

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).

type UpdaterT m a = a -> ChangeT m a Source #

runUpdaterT :: Functor m => UpdaterT m a -> a -> m (a, Bool) Source #

Blindly run an updater.

class Monad m => MonadChange m where Source #

The class of change monads.

Methods

tellDirty Source #

Arguments

:: m ()

Mark computation as having changed something.

listenDirty :: m a -> m (a, Bool) Source #

Instances

Instances details
MonadChange Identity Source #

A mock change monad. Always assume change has happened.

Instance details

Defined in Agda.Utils.Update

Monad m => MonadChange (ChangeT m) Source # 
Instance details

Defined in Agda.Utils.Update

Methods

tellDirty :: ChangeT m () Source #

listenDirty :: ChangeT m a -> ChangeT m (a, Bool) Source #

Monad m => MonadChange (IdentityT m) Source # 
Instance details

Defined in Agda.Utils.Update

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.

dirty :: Monad m => UpdaterT m a Source #

Mark a computation as dirty.

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.

Minimal complete definition

Nothing

Methods

updater1 :: Updater a -> Updater (f a) Source #

updates1 Source #

Arguments

:: Updater a 
-> Updater (f a)
= sharing . updater1

update1 :: Updater a -> EndoFun (f a) Source #

Instances

Instances details
Updater1 Maybe Source # 
Instance details

Defined in Agda.Utils.Update

Methods

updater1 :: Updater a -> Updater (Maybe a) Source #

updates1 :: Updater a -> Updater (Maybe a) Source #

update1 :: Updater a -> EndoFun (Maybe a) Source #

Updater1 List Source # 
Instance details

Defined in Agda.Utils.Update

Methods

updater1 :: Updater a -> Updater [a] Source #

updates1 :: Updater a -> Updater [a] Source #

update1 :: Updater a -> EndoFun [a] Source #

class Updater2 f where Source #

Like Bifunctor, but preserving sharing.

Minimal complete definition

updater2

Methods

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 #

Instances

Instances details
Updater2 Either Source # 
Instance details

Defined in Agda.Utils.Update

Methods

updater2 :: Updater a -> Updater b -> Updater (Either a b) Source #

updates2 :: Updater a -> Updater b -> Updater (Either a b) Source #

update2 :: Updater a -> Updater b -> EndoFun (Either a b) Source #

Updater2 (,) Source # 
Instance details

Defined in Agda.Utils.Update

Methods

updater2 :: Updater a -> Updater b -> Updater (a, b) Source #

updates2 :: Updater a -> Updater b -> Updater (a, b) Source #

update2 :: Updater a -> Updater b -> EndoFun (a, b) Source #