rzk-0.11.4: An experimental proof assistant for synthetic ∞-categories
Safe HaskellNone
LanguageHaskell2010

Rzk.Check.Convert

Description

Surface syntax to raw terms.

A transcription of Language.Rzk.Foil.Convert onto the pattern binder: a pattern becomes a Pattern with one fresh name per leaf, and the environment maps each leaf to its name. The shape of a binder becomes a tope family, a λ over the same pattern with the tope as its body.

Synopsis

Documentation

type SurfaceEnv (n :: S) = VarIdent -> Raw n Source #

What a surface identifier stands for in the current scope: a variable of the scope, or a term standing in for an identifier that is not in scope.

toRaw :: forall (n :: S). Distinct n => Scope n -> SurfaceEnv n -> Term -> Raw n Source #

Translate a surface term.

hintsOf :: Term -> [(Term, Term)] Source #

A simpler spelling of a surface construct, with the original and suggested terms. The collector traverses the original term without changing it.

withPattern :: forall (n :: S) r. Distinct n => Scope n -> Pattern -> SurfaceEnv n -> (forall (l :: S). DExt n l => Pattern n l -> Scope l -> SurfaceEnv l -> r) -> r Source #

Enter a pattern: a fresh name per leaf, each mapped by the environment to its name, and the rest of the environment carried in by coercion.