HORIZON HASKELLDocslts/ghc-10.0.x77a86622026-10-31Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 77a8662 · 2026-10-31

ModuleAgda-2.8.0.2Haskell2010

Agda.Syntax.Scope.Monad

The scope monad with operations.

Contents
  1. The scope checking monad
  2. General operations
  3. Names
  4. Resolving names
  5. Binding names
  6. Operations to do with record constructor names
  7. Module manipulation operations
  8. Import directives
  9. Opening a module
Synopsis
  • PackageAgda-2.8.0.2
  • Exports76
  • LanguageHaskell2010
  • LicenceMIT
  • SourceMonad.hs

The scope checking monad

typetype ScopeM = TCM

To simplify interaction between scope checking and type checking (in particular when chasing imports), we use the same monad.

General operations

valueoutsideLocalVars :: Int -> ScopeM a -> ScopeM a

Run a computation outside some number of local variables and add them back afterwards. This lets you bind variables in the middle of the context and is used when binding generalizable variables (#3735).

Names

Create a concrete name that is not yet in scope. | NOTE: See chooseName in Agda.Syntax.Translation.AbstractToConcrete for similar logic. | NOTE: See withName in Agda.Syntax.Translation.ReflectedToAbstract for similar logic.

Resolving names

Look up the abstract name corresponding to a concrete name of a certain kind and/or from a given set of names. Sometimes we know already that we are dealing with a constructor or pattern synonym (e.g. when we have parsed a pattern). Then, we can ignore conflicting definitions of that name of a different kind. (See issue 822.)

Binding names

Operations to do with record constructor names

Is this the qualified name which refers to the constructor of an anonymous record (like Foo.constructor)?

If so, return the part of the name referring to the record (Foo).

Module manipulation operations

Import directives

Opening a module

Orphan instances

1 instance