HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

ModuleAgda-2.7.0.1Haskell2010

Agda.TypeChecking.Monad.Modality

Modality.

Agda has support for several modalities, namely:

In order to type check such modalities, we must store the current modality in the typing context. This module provides functions to update the context based on a given modality.

See Agda.TypeChecking.Irrelevance.

  • 16 values
  • PackageAgda-2.7.0.1
  • Exports16
  • LanguageHaskell2010
  • LicenceMIT
  • SourceModality.hs

Operations on Dom.

1 declaration

Operations on Context.

15 declarations
valueworkOnTypes' :: MonadTCEnv m => Bool -> m a -> m a
#

Internal workhorse, expects value of --experimental-irrelevance flag as argument.

valueapplyRelevanceToContext
  1. :: (MonadTCEnv tcm, LensRelevance r)
  2. => r
  3. -> tcm a
  4. -> tcm a
#

(Conditionally) wake up irrelevant variables and make them relevant. For instance, in an irrelevant function argument otherwise irrelevant variables may be used, so they are awoken before type checking the argument.

Also allow the use of irrelevant definitions.

valueapplyRelevanceToContextOnly :: MonadTCEnv tcm => Relevance -> tcm a -> tcm a
#

(Conditionally) wake up irrelevant variables and make them relevant. For instance, in an irrelevant function argument otherwise irrelevant variables may be used, so they are awoken before type checking the argument.

Precondition: Relevance /= Relevant

valueapplyRelevanceToJudgementOnly
  1. :: MonadTCEnv tcm
  2. => Relevance
  3. -> tcm a
  4. -> tcm a
#

Apply relevance rel the the relevance annotation of the (typing/equality) judgement. This is part of the work done when going into a rel-context.

Precondition: Relevance /= Relevant

valueapplyModalityToContext
  1. :: (MonadTCEnv tcm, LensModality m)
  2. => m
  3. -> tcm a
  4. -> tcm a
#

(Conditionally) wake up irrelevant variables and make them relevant. For instance, in an irrelevant function argument otherwise irrelevant variables may be used, so they are awoken before type checking the argument.

Also allow the use of irrelevant definitions.

This function might also do something for other modalities.

valueapplyModalityToContextOnly :: MonadTCEnv tcm => Modality -> tcm a -> tcm a
#

(Conditionally) wake up irrelevant variables and make them relevant. For instance, in an irrelevant function argument otherwise irrelevant variables may be used, so they are awoken before type checking the argument.

This function might also do something for other modalities, but not for quantities.

Precondition: Modality /= Relevant

valuewakeIrrelevantVars :: MonadTCEnv tcm => tcm a -> tcm a
#

Wake up irrelevant variables and make them relevant. This is used when type checking terms in a hole, in which case you want to be able to (for instance) infer the type of an irrelevant variable. In the course of type checking an irrelevant function argument applyRelevanceToContext is used instead, which also sets the context relevance to Irrelevant. This is not the right thing to do when type checking interactively in a hole since it also marks all metas created during type checking as irrelevant (issue #2568).

Also set the current quantity to 0.