HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

ModuleAgda-2.7.0.1Haskell2010

Agda.TypeChecking.Names

EDSL to construct terms without touching De Bruijn indices.

e.g. given t, u :: Term, Γ ⊢ t, u : A, we can build "λ f. f t u" like this:

runNames [] $ do -- open binds t and u to computations that know how to weaken themselves in -- an extended context

t,u

<- mapM open [t,u]

  • - lam gives the illusion of HOAS by providing f as a computation.

  • - It also extends the internal context with the name "f", so that

  • - t and u will get weakened in the body.

  • - We apply f with the (@) combinator from Agda.TypeChecking.Primitive.

lam "f" $ f -> f @ t @ u

  • 7 types
  • 25 values
  • PackageAgda-2.7.0.1
  • Exports32
  • LanguageHaskell2010
  • LicenceMIT
  • SourceNames.hs
newtypenewtype NamesT (m :: Type -> Type) a
#

Constructors

Instances19MonadTrans, MonadError, MonadState, Monad, Functor, MonadFail, …
typetype Names = [String]
#

A list of variable names from a context.

valueinCxt :: (MonadFail m, Subst a) => Names -> a -> NamesT m a
#

inCxt Γ t takes a t in context Γ and produce an action that will return t weakened to the current context.

Fails whenever cxtSubst Γ would.

typetype Var (m :: Type -> Type) = forall b. (Subst b, DeBruijn b) => NamesT m b
#

Monadic actions standing for variables.

b is quantified over so the same variable can be used e.g. both as a pattern and as an expression.

Helpers to build lambda abstractions.

3 declarations

Combinators for n-ary binders.

16 declarations