Various classes of metavariables.
Constructors
RecordsMeta variables of record type.
SingletonRecordsMeta variables of "hereditarily singleton" record type.
LevelsMeta variables of level type, if type-in-type is activated.
:: a typeCtrl KGHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05
ModuleAgda-2.7.0.1Haskell2010
Various classes of metavariables.
RecordsMeta variables of record type.
SingletonRecordsMeta variables of "hereditarily singleton" record type.
LevelsMeta variables of level type, if type-in-type is activated.
All possible metavariable classes.
class (MonadConstraint m, MonadReduce m, MonadAddContext m, MonadTCEnv m, ReadTCState m, HasBuiltins m, HasConstInfo m, MonadDebug m) => MonadMetaSolver (m :: Type -> Type) whereMonad service class for creating, solving and eta-expanding of metavariables.
newMeta' :: MetaInstantiation -> Frozen -> MetaInfo -> MetaPriority -> Permutation -> Judgement a -> m MetaIdGenerate a new meta variable with some instantiation given. For instance, the instantiation could be a PostponedTypeCheckingProblem.
assignV :: CompareDirection -> MetaId -> Args -> Term -> CompareAs -> m ()Assign to an open metavar which may not be frozen. First check that metavar args are in pattern fragment. Then do extended occurs check on given thing.
Assignment is aborted by throwing a PatternErr via a call to
patternViolation. This error is caught by catchConstraint
during equality checking (compareAtom) and leads to
restoration of the original constraints.
assignTerm' :: MonadMetaSolver m => MetaId -> [Arg ArgName] -> Term -> m ()Directly instantiate the metavariable. Skip pattern check, occurs check and frozen check. Used for eta expanding frozen metas.
etaExpandMeta :: [MetaClass] -> MetaId -> m ()Eta-expand a local meta-variable, if it is of the specified class. Don't do anything if the meta-variable is a blocked term.
updateMetaVar :: MetaId -> (MetaVariable -> MetaVariable) -> m ()Update the status of the metavariable
speculateMetas :: m () -> m KeepMetas -> m ()'speculateMetas fallback m' speculatively runs m, but if the
result is RollBackMetas any changes to metavariables are
rolled back and fallback is run instead.
MonadMetaSolver TCMDefined in Agda-2.7.0.1 · Agda.TypeChecking.MetaVars · orphan(PureTCM m, MonadBlock m) => MonadMetaSolver (PureConversionT m)Defined in Agda-2.7.0.1 · Agda.TypeChecking.Conversion.PureMonadMetaSolver m => MonadMetaSolver (ReaderT r m)Defined in Agda-2.7.0.1 · Agda.TypeChecking.Monad.MetaVarsSwitch off assignment of metas.
Is the meta-variable from another top-level module?
If another meta-variable is created, then it will get this MetaId (unless the state is changed too much, for instance by setTopLevelModule).
Pairs of local meta-stores.
LocalMetaStoresopenMetas :: LocalMetaStoreA MetaStore containing open meta-variables.
solvedMetas :: LocalMetaStoreA MetaStore containing instantiated meta-variables.
Run a computation and record which new metas it created.
Find information about the given local meta-variable, if any.
Find information about the given local meta-variable.
Find information about the (local or remote) meta-variable, if any.
If no meta-variable is found, then the reason could be that the
dead-code elimination
(eliminateDeadCode) failed to find the
meta-variable, perhaps because some NamesIn instance is
incorrectly defined.
Find the meta-variable's instantiation.
Find the meta-variable's judgement.
Find the meta-variable's modality.
The type of a term or sort meta-variable.
Update the information associated with a local meta-variable.
Insert a new meta-variable with associated information into the local meta store.
Returns the MetaPriority of the given local meta-variable.
If a meta variable is still open, what is its kind?
Compute the context variables that a local meta-variable should be applied to, accounting for pruning.
Given a local meta-variable, return the type applied to the current context.
Is it a local meta-variable that might be generalized?
Check whether all metas are instantiated. Precondition: argument is a meta (in some form) or a list of metas.
isInstantiatedMeta :: (MonadFail m, ReadTCState m) => a -> m BoolIsInstantiatedMeta MetaIdDefined in Agda-2.7.0.1 · Agda.TypeChecking.Monad.MetaVarsIsInstantiatedMeta LevelDefined in Agda-2.7.0.1 · Agda.TypeChecking.Monad.MetaVarsIsInstantiatedMeta PlusLevelDefined in Agda-2.7.0.1 · Agda.TypeChecking.Monad.MetaVarsIsInstantiatedMeta TermDefined in Agda-2.7.0.1 · Agda.TypeChecking.Monad.MetaVarsIsInstantiatedMeta a => IsInstantiatedMeta (Arg a)Defined in Agda-2.7.0.1 · Agda.TypeChecking.Monad.MetaVarsIsInstantiatedMeta a => IsInstantiatedMeta (Abs a)Defined in Agda-2.7.0.1 · Agda.TypeChecking.Monad.MetaVarsDoes not worry about raising.
IsInstantiatedMeta a => IsInstantiatedMeta (Maybe a)Defined in Agda-2.7.0.1 · Agda.TypeChecking.Monad.MetaVarsIsInstantiatedMeta a => IsInstantiatedMeta [a]Defined in Agda-2.7.0.1 · Agda.TypeChecking.Monad.MetaVarsReturns all metavariables in a constraint. Slightly complicated by the fact that blocked terms are represented by two meta variables. To find the second one we need to look up the meta listeners for the one in the UnBlock constraint. This is used for the purpose of deciding if a metavariable is constrained or if it can be generalized over (see Agda.TypeChecking.Generalize).
Create MetaInfo in the current environment.
Change the ArgInfo that will be used when generalizing over this local meta-variable.
freshInteractionId :: m InteractionIdmodifyInteractionPoints :: (InteractionPoints -> InteractionPoints) -> m ()MonadInteractionPoints AbsToConDefined in Agda-2.7.0.1 · Agda.Syntax.Translation.AbstractToConcreteMonadInteractionPoints TCMDefined in Agda-2.7.0.1 · Agda.TypeChecking.Monad.MetaVars(PureTCM m, MonadBlock m) => MonadInteractionPoints (PureConversionT m)Defined in Agda-2.7.0.1 · Agda.TypeChecking.Conversion.PureMonadInteractionPoints m => MonadInteractionPoints (IdentityT m)Defined in Agda-2.7.0.1 · Agda.TypeChecking.Monad.MetaVarsMonadInteractionPoints m => MonadInteractionPoints (ReaderT r m)Defined in Agda-2.7.0.1 · Agda.TypeChecking.Monad.MetaVarsMonadInteractionPoints m => MonadInteractionPoints (StateT s m)Defined in Agda-2.7.0.1 · Agda.TypeChecking.Monad.MetaVarsRegister an interaction point during scope checking. If there is no interaction id yet, create one.
Find an interaction point by Range by searching the whole map. Issue 3000: Don't consider solved interaction points.
O(n): linear in the number of registered interaction points.
Hook up a local meta-variable to an interaction point.
Mark an interaction point as solved.
Get a list of interaction ids.
Get all metas that correspond to unsolved interaction ids.
Get all metas that correspond to unsolved interaction ids.
Does the meta variable correspond to an interaction point?
Time: O(log n) where n is the number of interaction metas.
Get the information associated to an interaction point.
Get MetaId for an interaction point. Precondition: interaction point is connected.
Check whether an interaction id is already associated with a meta variable.
Generate new meta variable.
Generate a new meta variable with some instantiation given. For instance, the instantiation could be a PostponedTypeCheckingProblem.
Get the Range for an interaction point.
Get the Range for a local meta-variable.
listenToMeta l m: register l as a listener to m. This is done
when the type of l is blocked by m.
Unregister a listener.
Get the listeners for a local meta-variable.
Do safe eta-expansions for meta (SingletonRecords,Levels).
Eta expand metavariables listening on the current meta.
Wake up a meta listener and let it do its thing
Freeze the given meta-variables (but only if they are open) and return those that were not already frozen.
Thaw all open meta variables.
Unfreeze a meta and its type if this is a meta again. Does not unfreeze deep occurrences of meta-variables or remote meta-variables.
unfreezeMeta :: MonadMetaSolver m => a -> m ()UnFreezeMeta MetaIdDefined in Agda-2.7.0.1 · Agda.TypeChecking.Monad.MetaVarsUnFreezeMeta LevelDefined in Agda-2.7.0.1 · Agda.TypeChecking.Monad.MetaVarsUnFreezeMeta PlusLevelDefined in Agda-2.7.0.1 · Agda.TypeChecking.Monad.MetaVarsUnFreezeMeta SortDefined in Agda-2.7.0.1 · Agda.TypeChecking.Monad.MetaVarsUnFreezeMeta TermDefined in Agda-2.7.0.1 · Agda.TypeChecking.Monad.MetaVarsUnFreezeMeta TypeDefined in Agda-2.7.0.1 · Agda.TypeChecking.Monad.MetaVarsUnFreezeMeta a => UnFreezeMeta (Abs a)Defined in Agda-2.7.0.1 · Agda.TypeChecking.Monad.MetaVarsUnFreezeMeta a => UnFreezeMeta [a]Defined in Agda-2.7.0.1 · Agda.TypeChecking.Monad.MetaVars