Lean2Js.Gather
What a package is made of #
The constants a package's namespace declares, in the order they were written, and the program built out
of them. The order matters twice: a call has to reach a declaration already emitted, which is what
Cost.progOk asks, and everything else keeps the order the author wrote so that the generated module
reads like the source.
Lean2Js.Core.Dsl.declNameFor
sourceThe declaration read out of a def the package ships.
Equations
- Lean2Js.Core.Dsl.declNameFor n = n.appendAfter "Decl"
Instances For
Used by
Lean2Js.Core.Dsl.certificateNameFor
sourceThe certificate for a def the package ships.
Equations
- Lean2Js.Core.Dsl.certificateNameFor n = n.appendAfter "_certificate"
Instances For
Used by
Lean2Js.Core.Dsl.shipAttr
sourceThe defs a package ships. Marking one reads the declaration out of it, so a declaration reaches the
program only through the walk that proves what it denotes: there is no way to put an AST into a program by
hand.
@[ship internal] ships the declaration without putting it in the API: other declarations call it, and
it is named by neither the exports of index.js nor index.d.ts. It is the way to keep a helper out of
the published surface without paying @[expand]'s fuel at every call site. The word is not private:
Lean's own private takes the name out of the namespace, so the walk never sees the def at all, and
it is what keeps a scaffolding lemma from shipping as a claim.
The mark is not @[export] either: Lean's own @[export] names a C symbol. A declaration taking a
function stays internal whatever is written above it, because its type says so (Decl.isPublic).
Used by
Lean2Js.Core.Dsl.isShipped
sourceWhether n is one of the defs the package ships.
Equations
- Lean2Js.Core.Dsl.isShipped env n = (Lean2Js.Core.Dsl.shipAttr.getParam? env n).isSome
Instances For
Used by
Lean2Js.Core.Dsl.namespaceMembers
sourceThe constants a package is made of: those declared directly in ns, in the order they were written.
Private ones and the ones Lean generates are left out, which is how a helper stays out of the package.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Core.Dsl.evalProgram
sourceUsed by
Lean2Js.Core.Dsl.Shipped
sourceOne shipped def: the def itself, the declaration read out of it, and what that declaration is.
Instances For
Used by
Lean2Js.Core.Dsl.shipped
sourceWhat ns ships, ordered so that every call goes backwards and otherwise in the order the defs
were written.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Core.Dsl.shippedTypes
sourceThe types ns declares, which are the ones deriving Enc wrote a TypeDef for.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Core.Dsl.«termProgram%»
sourceEverything ns ships, above this point. The declarations are ordered so that every call goes
backwards, and otherwise kept in the order they were written.
Equations
- Lean2Js.Core.Dsl.«termProgram%» = Lean.ParserDescr.node `Lean2Js.Core.Dsl.«termProgram%» 1024 (Lean.ParserDescr.symbol "program%")