Safe Haskell | None |
---|---|
Language | Haskell2010 |
EDSL to construct terms without touching De Bruijn indices.
e.g. if 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
andu
will get weakened in the body. - - Then we finish the job using the (@) combinator from Agda.TypeChecking.Primitive
Documentation
Instances
cl' :: Applicative m => a -> NamesT m a Source #
bind' :: (MonadFail m, Subst b, DeBruijn b, Subst a, Free a) => ArgName -> (NamesT m b -> NamesT m a) -> NamesT m a Source #
bind :: (MonadFail m, Subst b, DeBruijn b, Subst a, Free a) => ArgName -> (NamesT m b -> NamesT m a) -> NamesT m (Abs a) Source #
glam :: MonadFail m => ArgInfo -> ArgName -> (NamesT m Term -> NamesT m Term) -> NamesT m Term Source #