HORIZON HASKELLDocslts/ghc-10.0.x8fef28d2026-11-02Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8fef28d · 2026-11-02

ModuleAgda-2.8.0.2Haskell2010

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

Contents
  1. Helpers to build lambda abstractions.
  2. Combinators for n-ary binders.
Synopsis
  • PackageAgda-2.8.0.2
  • Exports32
  • LanguageHaskell2010
  • LicenceMIT
  • SourceNames.hs
newtypenewtype NamesT (m :: Type -> Type) a
#

Constructors

Instances18MonadTrans, MonadError, MonadState, Monad, Functor, Applicative, …
valueinCxt :: (Monad 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.

Combinators for n-ary binders.