| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Rzk.Check.Display
Description
Showing a term to the user: the names of a context, and a core term back to surface syntax under them.
A term of the core names its variables by Name, so anything
user-facing has to say what each name is called: a Naming gives a
display name per name in scope and a supply of fresh names for the
binders the printer meets. A binder inside the term is freshened only
against the names the term mentions, so a type shows the binder it was
written with. This follows the display naming of the old checker
(Rzk.TypeCheck.Display).
Synopsis
- data Naming (n :: S) = Naming {
- namingOf :: NameMap n VarIdent
- namingUsed :: [VarIdent]
- namingSupply :: [VarIdent]
- namingOfContext :: forall (n :: S). Context n -> Naming n
- displayOf :: forall (n :: S). Naming n -> Name n -> VarIdent
- ppName :: forall (n :: S). Naming n -> Name n -> String
- renderCore :: forall (n :: S). Distinct n => Naming n -> Core n -> Term
- ppCore :: forall (n :: S). Distinct n => Naming n -> Core n -> String
- ppValue :: forall (n :: S). Distinct n => Scope n -> Context n -> Value n -> String
- ppValueIn :: forall (n :: S). Distinct n => Context n -> Value n -> String
Documentation
What every name in scope is called, and what the printer may call the binders it has yet to meet.
Constructors
| Naming | |
Fields
| |
namingOfContext :: forall (n :: S). Context n -> Naming n Source #
Read the naming off a context: a named entry keeps its name, refreshed if an outer one has taken it; an anonymous one draws from the supply. Entries are named oldest binding first, so an outer binder keeps its name and an inner one is refreshed away from it.
renderCore :: forall (n :: S). Distinct n => Naming n -> Core n -> Term Source #
A core term as surface syntax, with the context's names.