Lean2Js.Helper
The runtime helpers the generated code calls, held as a tree #
The runtime helpers the generated code calls, held as a tree rather than as a block of text.
This is a different language from Js.Expr. Js.Expr is the subset the compiler writes, and its
narrowness is what lets the reader in Parse.lean take the whole file back; the helpers need loops,
mutable bindings and throw, none of which the compiler ever emits. Giving them their own tree keeps
the compiler's tree exactly as narrow as the roundtrip claim needs it.
The builtins the helpers reach for are named in prim and method rather than spelled into a call, so
what the model has to assume about JavaScript is a table one can read off the tree.
Lean2Js.Helper.Expr
sourceInstances For
Used by
Lean2Js.Helper.instInhabitedExpr
sourceEquations
Used by
Lean2Js.Helper.instBEqExpr.beq
sourceUsed by
Lean2Js.Helper.instBEqExpr
sourceEquations
Used by
Lean2Js.Helper.Stmt
sourceInstances For
Used by
Lean2Js.Helper.instInhabitedStmt
sourceEquations
Used by
Lean2Js.Helper.instBEqStmt.beq
sourceUsed by
Lean2Js.Helper.instBEqStmt
sourceEquations
Used by
Lean2Js.Helper.Body
sourceInstances For
Used by
Lean2Js.Helper.instInhabitedBody
sourceEquations
Used by
Lean2Js.Helper.instBEqBody.beq
sourceEquations
Instances For
Used by
Lean2Js.Helper.instBEqBody
sourceEquations
Used by
Lean2Js.Helper.Def
sourceInstances For
Used by
Lean2Js.Helper.instInhabitedDef
sourceEquations
Used by
Lean2Js.Helper.instBEqDef
sourceEquations
Used by
Lean2Js.Helper.instBEqDef.beq
sourceEquations
- One or more equations did not get rendered due to their size.
- Lean2Js.Helper.instBEqDef.beq x✝¹ x✝ = false
Instances For
Used by
The printer #
Lean2Js.Helper.renderNames
sourceEquations
- Lean2Js.Helper.renderNames [] = ""
- Lean2Js.Helper.renderNames [n] = n
- Lean2Js.Helper.renderNames (n :: rest) = n ++ ", " ++ Lean2Js.Helper.renderNames rest
Instances For
Used by
Lean2Js.Helper.Expr.render
sourceParentheses are always written, without consulting precedence, for the reason Js.Expr.render
writes them: a table of precedences would go on the trusted base while buying only shorter output.
Equations
- (Lean2Js.Helper.Expr.num i).render = Lean2Js.renderInt i
- (Lean2Js.Helper.Expr.big i).render = Lean2Js.renderInt i ++ "n"
- (Lean2Js.Helper.Expr.str s).render = "\"" ++ Lean2Js.escapeString s ++ "\""
- (Lean2Js.Helper.Expr.bool b).render = if b = true then "true" else "false"
- Lean2Js.Helper.Expr.null.render = "null"
- Lean2Js.Helper.Expr.undef.render = "undefined"
- (Lean2Js.Helper.Expr.var name).render = name
- e.not.render = "(!" ++ e.render ++ ")"
- e.neg.render = "(-" ++ e.render ++ ")"
- e.typeOf.render = "(typeof " ++ e.render ++ ")"
- (Lean2Js.Helper.Expr.bin op lhs rhs).render = "(" ++ lhs.render ++ " " ++ op ++ " " ++ rhs.render ++ ")"
- (lhs.andAlso rhs).render = "(" ++ lhs.render ++ " && " ++ rhs.render ++ ")"
- (lhs.orElse rhs).render = "(" ++ lhs.render ++ " || " ++ rhs.render ++ ")"
- e.isMap.render = "(" ++ e.render ++ " instanceof Map)"
- (c.cond t e).render = "(" ++ c.render ++ " ? " ++ t.render ++ " : " ++ e.render ++ ")"
- (Lean2Js.Helper.Expr.call name args).render = name ++ "(" ++ Lean2Js.Helper.Expr.renderList args ++ ")"
- (Lean2Js.Helper.Expr.prim name args).render = name ++ "(" ++ Lean2Js.Helper.Expr.renderList args ++ ")"
- (recv.method name args).render = "(" ++ recv.render ++ ")." ++ name ++ "(" ++ Lean2Js.Helper.Expr.renderList args ++ ")"
- (f.apply args).render = "(" ++ f.render ++ ")(" ++ Lean2Js.Helper.Expr.renderList args ++ ")"
- (Lean2Js.Helper.Expr.new_ cls args).render = "new " ++ cls ++ "(" ++ Lean2Js.Helper.Expr.renderList args ++ ")"
- (recv.field name).render = "(" ++ recv.render ++ ")." ++ name
- (recv.index idx).render = "(" ++ recv.render ++ ")[" ++ idx.render ++ "]"
- (Lean2Js.Helper.Expr.arrayLit items).render = "[" ++ Lean2Js.Helper.Expr.renderList items ++ "]"
- (Lean2Js.Helper.Expr.objLit fields).render = "{ " ++ Lean2Js.Helper.Expr.renderFields fields ++ " }"
- (Lean2Js.Helper.Expr.lam params body).render = "((" ++ Lean2Js.Helper.renderNames params ++ ") => " ++ body.render ++ ")"
Instances For
Used by
Lean2Js.Helper.Expr.renderList
sourceEquations
- Lean2Js.Helper.Expr.renderList [] = ""
- Lean2Js.Helper.Expr.renderList [e] = e.render
- Lean2Js.Helper.Expr.renderList (e :: rest) = e.render ++ ", " ++ Lean2Js.Helper.Expr.renderList rest
Instances For
Used by
Lean2Js.Helper.Expr.renderFields
sourceEquations
Instances For
Used by
Lean2Js.Helper.indentOf
sourceEquations
Instances For
Used by
Lean2Js.Helper.Stmt.render
sourceEquations
- One or more equations did not get rendered due to their size.
- Lean2Js.Helper.Stmt.render depth (Lean2Js.Helper.Stmt.const name val) = Lean2Js.Helper.indentOf depth ++ "const " ++ name ++ " = " ++ val.render ++ ";"
- Lean2Js.Helper.Stmt.render depth (Lean2Js.Helper.Stmt.letMut name val) = Lean2Js.Helper.indentOf depth ++ "let " ++ name ++ " = " ++ val.render ++ ";"
- Lean2Js.Helper.Stmt.render depth (Lean2Js.Helper.Stmt.setVar name val) = Lean2Js.Helper.indentOf depth ++ name ++ " = " ++ val.render ++ ";"
- Lean2Js.Helper.Stmt.render depth (Lean2Js.Helper.Stmt.setField name field val) = Lean2Js.Helper.indentOf depth ++ name ++ "." ++ field ++ " = " ++ val.render ++ ";"
- Lean2Js.Helper.Stmt.render depth (Lean2Js.Helper.Stmt.push name val) = Lean2Js.Helper.indentOf depth ++ name ++ ".push(" ++ val.render ++ ");"
- Lean2Js.Helper.Stmt.render depth (Lean2Js.Helper.Stmt.setKey name key val) = Lean2Js.Helper.indentOf depth ++ name ++ ".set(" ++ key.render ++ ", " ++ val.render ++ ");"
- Lean2Js.Helper.Stmt.render depth (Lean2Js.Helper.Stmt.ret e) = Lean2Js.Helper.indentOf depth ++ "return " ++ e.render ++ ";"
- Lean2Js.Helper.Stmt.render depth Lean2Js.Helper.Stmt.brk = Lean2Js.Helper.indentOf depth ++ "break;"
- Lean2Js.Helper.Stmt.render depth (Lean2Js.Helper.Stmt.throwErr e) = Lean2Js.Helper.indentOf depth ++ "throw " ++ e.render ++ ";"
Instances For
Used by
Lean2Js.Helper.Stmt.renderAll
sourceEquations
- Lean2Js.Helper.Stmt.renderAll depth [] = ""
- Lean2Js.Helper.Stmt.renderAll depth [s] = Lean2Js.Helper.Stmt.render depth s
- Lean2Js.Helper.Stmt.renderAll depth (s :: rest) = Lean2Js.Helper.Stmt.render depth s ++ "\n" ++ Lean2Js.Helper.Stmt.renderAll depth rest
Instances For
Used by
Lean2Js.Helper.renderDoc
sourceEquations
- Lean2Js.Helper.renderDoc [] = ""
- Lean2Js.Helper.renderDoc (line :: rest) = "// " ++ line ++ "\n" ++ Lean2Js.Helper.renderDoc rest
Instances For
Used by
Lean2Js.Helper.Def.render
sourceOne top-level const per helper, so a bundler can drop the ones the entry point never reaches.
treeshaking.test.ts is what holds this shape in place.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.renderAll
sourceEquations
- Lean2Js.Helper.renderAll [] = ""
- Lean2Js.Helper.renderAll [d] = d.render
- Lean2Js.Helper.renderAll (d :: rest) = d.render ++ "\n\n" ++ Lean2Js.Helper.renderAll rest
Instances For
Used by
The helpers #
The operations where JavaScript and Lean split on the answer are confined to these definitions.
Lean2Js.Helper.divByZero
sourceEquations
- Lean2Js.Helper.divByZero = Lean2Js.Helper.Expr.call "__fail" [Lean2Js.Helper.Expr.str "divByZero"]
Instances For
Used by
Lean2Js.Helper.outOfBounds
sourceEquations
- Lean2Js.Helper.outOfBounds = Lean2Js.Helper.Expr.call "__fail" [Lean2Js.Helper.Expr.str "indexOutOfBounds"]
Instances For
Used by
Lean2Js.Helper.and2
sourceEquations
- Lean2Js.Helper.and2 [] = Lean2Js.Helper.Expr.bool true
- Lean2Js.Helper.and2 [e] = e
- Lean2Js.Helper.and2 (e :: rest) = e.andAlso (Lean2Js.Helper.and2 rest)
Instances For
Used by
Lean2Js.Helper.or2
sourceEquations
- Lean2Js.Helper.or2 [] = Lean2Js.Helper.Expr.bool false
- Lean2Js.Helper.or2 [e] = e
- Lean2Js.Helper.or2 (e :: rest) = e.orElse (Lean2Js.Helper.or2 rest)
Instances For
Used by
Lean2Js.Helper.lengthOf
sourceEquations
- Lean2Js.Helper.lengthOf e = e.field "length"
Instances For
Used by
Lean2Js.Helper.fail
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.i53
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.i53div
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.i53mod
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.u32mul
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.u32div
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.u32mod
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.bigdiv
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.bigmod
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.abs
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.min
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.max
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.chars
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.cp
sourceEquations
- Lean2Js.Helper.cp = { name := "__cp", params := ["c"], body := Lean2Js.Helper.Body.expr ((Lean2Js.Helper.Expr.var "c").method "codePointAt" [Lean2Js.Helper.Expr.num 0]) }
Instances For
Used by
Lean2Js.Helper.str
sourceEquations
- Lean2Js.Helper.str = { name := "__str", params := ["x"], body := Lean2Js.Helper.Body.expr (Lean2Js.Helper.Expr.prim "String" [Lean2Js.Helper.Expr.var "x"]) }
Instances For
Used by
Lean2Js.Helper.toInt
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.strlen
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.strcmp
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.ws
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.lead
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.trim
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.upper
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.lower
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.startsWith
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.endsWith
sourceEquations
- Lean2Js.Helper.endsWith = { name := "__endsWith", params := ["s", "t"], body := Lean2Js.Helper.Body.expr ((Lean2Js.Helper.Expr.var "s").method "endsWith" [Lean2Js.Helper.Expr.var "t"]) }
Instances For
Used by
Lean2Js.Helper.includes
sourceEquations
- Lean2Js.Helper.includes = { name := "__includes", params := ["s", "t"], body := Lean2Js.Helper.Body.expr ((Lean2Js.Helper.Expr.var "s").method "includes" [Lean2Js.Helper.Expr.var "t"]) }
Instances For
Used by
Lean2Js.Helper.split
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.startsAt
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.indexOf
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.join
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.repeat
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.rep
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.range
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.substring
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.aslice
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.aconcat
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.areverse
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.atIdx
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.dget
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.dhas
sourceEquations
- Lean2Js.Helper.dhas = { name := "__dhas", params := ["d", "k"], body := Lean2Js.Helper.Body.expr ((Lean2Js.Helper.Expr.var "d").method "has" [Lean2Js.Helper.Expr.var "k"]) }
Instances For
Used by
Lean2Js.Helper.dset
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.dkeys
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.dvalues
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.ddelete
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.eqMaps
source__eq on two Maps: same size, then the keys in the order the iterators hand them over.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.eqArrays
source__eq on two arrays: same length, then element by element.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.eq
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.map
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.filter
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.find
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.all
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.any
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.reduce
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.keyle
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.mergeBody
sourceNamed rather than written into merge so that a proof about the loop can be stated about the same
tree the printer writes.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.merge
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.msort
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.sortBy
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.isObj
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.hasFields
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
__has dispatches on the head of the descriptor, and every branch below is named so that a proof
walking one of them does not pay for expanding the ten it did not take.
Lean2Js.Helper.hasBool
sourceEquations
- Lean2Js.Helper.hasBool = [Lean2Js.Helper.Stmt.ret (Lean2Js.Helper.Expr.bin "===" (Lean2Js.Helper.Expr.var "x").typeOf (Lean2Js.Helper.Expr.str "boolean"))]
Instances For
Used by
Lean2Js.Helper.hasInt53
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.hasUint32
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.hasString
sourceEquations
Instances For
Used by
Lean2Js.Helper.hasBigint
sourceEquations
Instances For
Used by
Lean2Js.Helper.hasArray
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.hasDict
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.hasDictObj
sourceA dictionary declared to cross as a plain object. The object guard this branch sits behind has
already refused everything that is not one, so what is left is that every value the object carries
answers for the element type. A Map reaches this branch too — typeof calls one an object, and a
declaration that hands one back is a value a caller may hand straight back in — so the values are read
whichever way the argument holds them. Object.values is the twin of the Object.keys __eq walks.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.hasOption
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.hasResult
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
The key a declared type tells its constructors apart by is read off the descriptor rather than
spelled in: an author chooses it per type, and the helpers are one copy for the whole package. The
tags below are __find's own answer, which is an Option and not the value being checked.
Lean2Js.Helper.hasCtors
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
A declared type that names itself is expanded once and bound: mu carries the same key and
alternatives a ctors does, and binds them; a ref names the binder that many levels out. Both hand the
walk the ctors node the binder holds, under the environment that node was bound in, so everything below
them is the walk that was already there.
Lean2Js.Helper.pushed
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.bound
sourceThe binder the ref names, read out of the environment.
Equations
Instances For
Used by
Lean2Js.Helper.asBoundCtors
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.outer
sourceThe environment from the binder named outwards. Dropping what is nearer than it is what makes the answer the same as if the type had been expanded here rather than bound above.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.hasMu
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.hasRef
sourceAn index no binder answers is refused rather than read: the descriptor the compiler writes never holds one, and reading past the end would throw where the model says false.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.hasObjKinds
sourceThe tail after the object guard, named for the same reason the branches are: a proof that takes an earlier branch never expands it.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.hasBinders
sourceThe two that hand the walk a ctors node and carry on. They come first because they answer for a
value of any shape: what a mu or a ref accepts is whatever the node it stands for accepts, and that
includes refusing a value that is not an object at all.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.has
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
__norm rebuilds a value the entry check accepted in the shape encodeValue writes: the key the
constructor's name is carried under first, then the constructor's fields in the order the descriptor
names them. Keys the descriptor does not name are dropped. Branches are named for the reason __has's
are.
Lean2Js.Helper.normFields
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.normArray
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.normDict
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.normDictObj
sourceThe mirror of normDict for a dictionary that arrives as a plain object: the same Map, built out
of whichever shape the argument arrived in. Walking the entries rather than the keys is what keeps
each value normalised once: a key carried twice is a shape neither a Map nor an object has, and the
Map collapses it rather than the walk having to.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.normOption
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.normResult
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.normCtors
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.normMu
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.normRef
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.normBinders
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.norm
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
__out is __norm walked the other way: what the entry reads its result through on the way back
out. Every branch is __norm's, save the one this helper exists for — a dictionary declared to cross as
a plain object leaves as one, where __norm on the way in made the Map the body ran on. Branches are
named for the reason __has's are.
Lean2Js.Helper.outFields
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.outArray
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.outDict
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.outDictObj
sourceThe branch the helper exists for: a dictionary handed back as the plain object a consumer can
stringify. Inside the module a dictionary is a Map whatever it crosses as, so the guard answers for
every other shape by handing it back untouched rather than by having a second arm to walk.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.outOption
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.outResult
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.outCtors
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.outMu
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.outRef
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.outBinders
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.out
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.ck
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
__fold walks a value of a type that names itself, from the leaves up. What it hands the callback
is the node itself with each field that came round replaced by what the callback answered for it, so the
callback reads a node of the shape the type declares and dispatches on the key the constructor's name is
carried under — which is what a match does, and what the compiler compiles the alternatives to.
One callback rather than one per constructor is what keeps .apply at the arity it has: a constructor's
field count varies, and a helper cannot apply a callback to an argument list it only has at run time.
The spec is an object keyed by the constructor's name, holding that constructor's fields in declared
order as [name, kind]. The kind is read off the spec rather than off the value: which field comes
round is the declared type's to say, and a value that happens to hold an object is not a node.
Lean2Js.Helper.fold
sourceEquations
- One or more equations did not get rendered due to their size.
Instances For
Used by
Lean2Js.Helper.defs
sourceEquations
- One or more equations did not get rendered due to their size.