Declaration needs #
This file records the needs of declarations in a "non-baked-in" manner via DeclNeeds.
We record in what manner one declaration needs another (e.g. in its type), and then postpone the
calculation of what import needs this implies. This sets us up to provide finer explanations.
We also define ImportNeeds so that we can express when an import is allowed to be meta (or not).
Note that, crucially, DeclNeeds is agnostic to the source of our import hierarchy, as it uses
module names instead of e.g. ModuleIdxs/ModIdxs. Hence these functions are compatible with both
a WorkspaceModel approach and an Environment approach.
This file culminates in withElabCommandCapturingNeeds, which elaborates a command and captures
the (transitive) DeclNeeds of declarations produced in that command, including e.g. the needs
implied by the command's syntax.
Future Work #
- Write up more thorough documentation when this settles down.
- Handle meta IR.
- Performance: many of the data structures here could be improved. There's a lot of pointer-chasing.
- Revamp indirect mod uses. Currently they are associated with the declaration indirectly requiring
them and added to the decl import needs specially. Instead, we should split them out. Also, we
currently spoof the
kind. - Split out extra mod uses into a special command needs. Also put the syntax needs there; these should not be decl needs.
- Handle autogenerated declarations more consistently.
- Give a closer look to things like
@[csimp].
Shake declarations #
This section (fromShake) is inlined verbatim from shake, modulo whitespace.
Copyright (c) 2023 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Sebastian Ullrich
Equations
- One or more equations did not get rendered due to their size.
Instances For
Given an Expr reference, returns the declaration name that should be considered the reference, if
any, but from the environment directly.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A way in which a declaration might demand an imported module. Note that there may be multiple demands on the same module from the same declaration, which thus may require multiple of these.
The fields overlap with NeedsKind, except for meta?, as import needs may not specify a phase.
Instances For
Equations
- ImportGraph.Shake.ImportNeedsKind.pubRuntime = { toVisibilityKind := ImportGraph.Shake.NeedsKind.pub.toVisibilityKind, meta? := some false }
Instances For
Equations
- ImportGraph.Shake.ImportNeedsKind.privRuntime = { toVisibilityKind := ImportGraph.Shake.NeedsKind.priv.toVisibilityKind, meta? := some false }
Instances For
Equations
- ImportGraph.Shake.ImportNeedsKind.privOfPrivRuntime = { toVisibilityKind := ImportGraph.Shake.NeedsKind.privOfPriv.toVisibilityKind, meta? := some false }
Instances For
Equations
- ImportGraph.Shake.ImportNeedsKind.metaPub = { toVisibilityKind := ImportGraph.Shake.NeedsKind.metaPub.toVisibilityKind, meta? := some true }
Instances For
Equations
- ImportGraph.Shake.ImportNeedsKind.metaPriv = { toVisibilityKind := ImportGraph.Shake.NeedsKind.metaPriv.toVisibilityKind, meta? := some true }
Instances For
Equations
- ImportGraph.Shake.ImportNeedsKind.metaPrivOfPriv = { toVisibilityKind := ImportGraph.Shake.NeedsKind.metaPrivOfPriv.toVisibilityKind, meta? := some true }
Instances For
Equations
- ImportGraph.Shake.ImportNeedsKind.pubPhaseless = { toVisibilityKind := ImportGraph.Shake.NeedsKind.pub.toVisibilityKind, meta? := none }
Instances For
Equations
- ImportGraph.Shake.ImportNeedsKind.privPhaseless = { toVisibilityKind := ImportGraph.Shake.NeedsKind.priv.toVisibilityKind, meta? := none }
Instances For
Equations
- ImportGraph.Shake.ImportNeedsKind.privOfPrivPhaseless = { toVisibilityKind := ImportGraph.Shake.NeedsKind.privOfPriv.toVisibilityKind, meta? := none }
Instances For
Every possible ImportNeedsKind.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Turns a k : NeedsKind into a phased ImportNeeds, interpreting the isMeta flag as
specifying a runtime need when false and a meta need when true. Note that while this makes sense
under certain interpretations of a NeedsKind, it should be used with care, as shake's
ExtraModUses may record isMeta := false even when the import needed may optionally be meta.
Equations
- k.toPhasedImportNeedsKind = { toVisibilityKind := k.toVisibilityKind, meta? := some k.isMeta }
Instances For
Turns a visibility kind into the corresponding ImportNeedsKind that accepts either phase.
Equations
- v.toPhaselessImportNeedsKind = { toVisibilityKind := v, meta? := none }
Instances For
Like Needs, but splits apart by phase in order to express an actual import requirement (which
may or may not need a certain phase) instead of expressing an import specification per se:
<vis>Runtime: needs a non-meta importmeta<vis>: needs a meta import<vis>Phaseless: either a non-meta or meta import will do
- pubRuntime : Bitset
The modules whose public scopes are needed publicly at specifically the non-meta phase.
- privRuntime : Bitset
The modules whose public scopes are needed privately at specifically the non-meta phase.
- privOfPrivRuntime : Bitset
The modules whose private scopes are needed at specifically the non-meta phase.
- metaPub : Bitset
The modules whose public scopes are needed publicly at the meta phase.
- metaPriv : Bitset
The modules whose public scopes are needed privately at the meta phase.
- metaPrivOfPriv : Bitset
The modules whose private scopes are needed at the meta phase.
- pubPhaseless : Bitset
The modules whose public scopes are needed publicly at either the meta or non-meta phase.
- privPhaseless : Bitset
The modules whose public scopes are needed privately at either the meta or non-meta phase.
- privOfPrivPhaseless : Bitset
The modules whose private scopes are needed at either the meta or non-meta phase.
Instances For
Equations
Equations
Equations
- One or more equations did not get rendered due to their size.
- ImportGraph.Shake.instBEqImportNeeds.beq x✝¹ x✝ = false
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- ImportGraph.Shake.ImportNeeds.instEmptyCollection = { emptyCollection := ImportGraph.Shake.ImportNeeds.empty }
Takes into account public ⊆ private for unambiguous phase specifications.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Removes private when implied by public or all for unambiguous phase specifications.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Ensures that we only keep phaseless entries when no other phase is specified for that index. Does not take into account phase specifications due to linearization. Depending on the application, consider linearizing the phased needs first.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The phased needs of an ImportNeeds. Completely ignores the phaseless needs.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Assumes that Provides is well-formed, i.e. is linearized and transitively closed.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- needs.get { isExported := true, not_isExported_and_isAll := ⋯, meta? := some false } = needs.pubRuntime
- needs.get { isExported := false, not_isExported_and_isAll := ⋯, meta? := some false } = needs.privRuntime
- needs.get { isExported := false, isAll := true, not_isExported_and_isAll := ⋯, meta? := some false } = needs.privOfPrivRuntime
- needs.get { isExported := true, not_isExported_and_isAll := ⋯, meta? := some true } = needs.metaPub
- needs.get { isExported := false, not_isExported_and_isAll := ⋯, meta? := some true } = needs.metaPriv
- needs.get { isExported := false, isAll := true, not_isExported_and_isAll := ⋯, meta? := some true } = needs.metaPrivOfPriv
- needs.get { isExported := true, not_isExported_and_isAll := ⋯, meta? := none } = needs.pubPhaseless
- needs.get { isExported := false, not_isExported_and_isAll := ⋯, meta? := none } = needs.privPhaseless
- needs.get { isExported := false, isAll := true, not_isExported_and_isAll := ⋯, meta? := none } = needs.privOfPrivPhaseless
Instances For
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- needs.union k s = needs.modify k fun (x : ImportGraph.Shake.Bitset) => x ∪ s
Instances For
Equations
- needs.any f = ImportGraph.Shake.ImportNeedsKind.all.any fun (x : ImportGraph.Shake.ImportNeedsKind) => f (needs.get x)
Instances For
Equations
- needs.all f = ImportGraph.Shake.ImportNeedsKind.all.all fun (x : ImportGraph.Shake.ImportNeedsKind) => f (needs.get x)
Instances For
Equations
- needs.flatten = Array.foldl (fun (x1 : ImportGraph.Shake.Bitset) (x2 : ImportGraph.Shake.ImportNeedsKind) => x1 ∪ needs.get x2) ∅ ImportGraph.Shake.ImportNeedsKind.all
Instances For
Returns an antilinearized reduced : Needs such that
needs.isProvidedBy transDeps⟦reduced.linearize⟧
and reduced is minimal (perhaps non-uniquely) among such Needs.
metaBy modIdx v reducedSoFar : Bool specifies how to turn phaseless needs into phased needs. This
may be useful if we want to try preserving some phases from existing externally-provided imports,
for instance.
The returned reduced is antilinearized, and thus suitable for converting to imports.
Does not assume needs is linearized or narrowed.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Returns an antilinearized reduced : Needs such that
needs.isProvidedBy transDeps⟦reduced.linearize⟧
and reduced is minimal (perhaps non-uniquely) among such Needs.
If useMeta is false, then any phaseless needs not covered by phased needs are interpreted as run
time needs, and otherwise as meta needs.
The returned reduced is antilinearized, and thus suitable for converting to imports.
Does not assume needs is linearized or narrowed.
Equations
- needs.reduceSimple transDeps useMeta = needs.reduceBy transDeps fun (x : Nat) (x_1 : ImportGraph.Shake.VisibilityKind) (x_2 : ImportGraph.Shake.Needs) => useMeta
Instances For
A pair of braille cells depicting the import needs at index i.
In the left cell, the left column denotes definite non-meta needs (due to runtime IR). The right column denotes meta or non-meta needs.
The left column of the right cell denotes definitely meta needs. The right column of the right cell is unused.
The top row denotes public needs, the middle row private needs, and the bottom row private-of-private needs.
We call this brailleCellAt instead of brailleCellsAt so that dot notation does not accidentally
resolve to Needs.brailleCellAt.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A pair of braille cells depicting the import needs at index i.
In the left cell, the left column denotes definite non-meta needs (due to runtime IR). The right column denotes meta or non-meta needs.
The left column of the right cell denotes definitely meta needs. The right column of the right cell is unused.
The top row denotes public needs, the middle row private needs, and the bottom row private-of-private needs.
For the braille cell characters without brackets, see ImportNeeds.brailleCellAt.
Equations
Instances For
Represents an ImportNeeds as a string of the form e.g. │⠇⠁│⠑⠁│⠁│⠝⠁│, where each braille cell
represents the set of ImportNeedsKinds expressed by a single "column" of the ImportNeeds (i.e.
at a given index). The left column of the left cell is non-meta-only needs; the next column is
meta-or-non-meta needs; the next column is meta-only needs; and the final column is unused. The top
row holds public needs, the middle private, and the bottom private-of-private.
By default, shows dividers (│) between each braille cell; dividers := false omits dividers.
By default this shows only as many cells as necessary, or a single empty cell for an empty
ImportNeeds. Instead, univSize? : Option Nat can be provided to set the total number of
indices, and will either truncate (even if higher indices are set) or pad with empty cells as
appropriate.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Instances For
Information about the source of a compile-time dependency.
- indirect (use : Lean.IndirectModUse) (imposingModules : Array Lean.Name) : ComptimeDependency
A potential compile-time dependency due to an indirect mod use.
imposingModulerecords the module that imposed the indirect mod use (not the source module of the declaration). - stx (kind : Lean.SyntaxNodeKind) (pos? : Option Lean.Syntax.Range) : ComptimeDependency
A compile-time dependency due to parsing.
Instances For
Equations
- ImportGraph.Shake.instBEqComptimeDependency.beq (ImportGraph.Shake.ComptimeDependency.indirect a a_1) (ImportGraph.Shake.ComptimeDependency.indirect b b_1) = (a == b && a_1 == b_1)
- ImportGraph.Shake.instBEqComptimeDependency.beq (ImportGraph.Shake.ComptimeDependency.stx a a_1) (ImportGraph.Shake.ComptimeDependency.stx b b_1) = (a == b && a_1 == b_1)
- ImportGraph.Shake.instBEqComptimeDependency.beq x✝¹ x✝ = false
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
- ImportGraph.Shake.instOrdComptimeDependency.ord (ImportGraph.Shake.ComptimeDependency.indirect a a_1) x✝ = Ordering.lt
- ImportGraph.Shake.instOrdComptimeDependency.ord x✝ (ImportGraph.Shake.ComptimeDependency.indirect a a_1) = Ordering.gt
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- ImportGraph.Shake.instToMessageDataComptimeDependency = { toMessageData := fun (x : ImportGraph.Shake.ComptimeDependency) => x.toMessageData }
A location at which a ConstantInfo can reference another.
- type : ConstLocation
- value : ConstLocation
Instances For
Equations
- ImportGraph.Shake.instBEqConstLocation.beq x✝ y✝ = (x✝.ctorIdx == y✝.ctorIdx)
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- ImportGraph.Shake.instOrdConstLocation.ord x✝ y✝ = compare x✝.ctorIdx y✝.ctorIdx
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
A way in which a declaration tgt might need another declaration src. In general, the same
src and tgt may be related by multiple DeclDeclNeedsKinds.
- expr (downstream : ConstLocation) (isReExported : Option Bool := none) (upstream : ConstLocation := ConstLocation.type) : DeclDeclNeedsKind
Expresses a dependency of
tgt's location given bydownstreamonsrc's location given byupstream.isReExported := noneindicates that the exported value is inherited fromtgt'sisPublicorisExposedstance, as appropriate. (Occasionally this will besome falseif, for example, a proof is abstracted, since we count the dependencies of autogenerated declarations as part of the parent declaration.) - metaIR (isReExported : Option Bool := none) (through : List Lean.Name := []) : DeclDeclNeedsKind
Expresses a dependency of
tgtonsrcdue to the IR oftgt, which is meta-available. WhenisReExported := none, this is inherited from thetgt'sisPublicstance (the same as its type, not its value.)Meta IR is unusual in that while a private meta def may not re-export its references, a public meta def that uses that private meta def will re-export that private meta def's references. Note, also, that this dependency is determined by Lean from the initial LCNF (unless a same-module transitive dependency, in which case it is determined from that declaration's base LCNF), but is intended to capture IR dependency.
- runtimeIR : DeclDeclNeedsKind
Expresses a dependency of
tgtonsrcin the IR oftgt, which is only available at runtime. This does not have the complicated reference semantics of IR used for meta declarations. We assume, for now, that we do not need to think about changing runtime defs to meta defs, and thus do not need to record the same information. As such,checkMetas recursive check for non-aux decls is irrelevant, as the runtime IR constraints such a recursive check puts on a reference are redundant with the runtime IR constraints that already exist on that reference. However, note that, like meta declarations, this dependency is determined by Lean from the initial LCNF, though is intended to capture IR dependency. - comptime (source : ComptimeDependency) : DeclDeclNeedsKind
A compile-time dependency of
tgt(e.g. a parser used for notation in the command fortgt).If this arises due to an indirect mod use, we record the declaration that demanded it (if we can). Note that shake extensions do not expose this; this is known during the expression traversal. So some indirect mod uses will end up in
extraModUseswithout any indication as to the declaration that drew them (at least, not in a way that's accessible to us, though this information is traced by shake).We record this separately mainly for reporting.
Instances For
Equations
- ImportGraph.Shake.instBEqDeclDeclNeedsKind.beq (ImportGraph.Shake.DeclDeclNeedsKind.expr a a_1 a_2) (ImportGraph.Shake.DeclDeclNeedsKind.expr b b_1 b_2) = (a == b && (a_1 == b_1 && a_2 == b_2))
- ImportGraph.Shake.instBEqDeclDeclNeedsKind.beq (ImportGraph.Shake.DeclDeclNeedsKind.metaIR a a_1) (ImportGraph.Shake.DeclDeclNeedsKind.metaIR b b_1) = (a == b && a_1 == b_1)
- ImportGraph.Shake.instBEqDeclDeclNeedsKind.beq ImportGraph.Shake.DeclDeclNeedsKind.runtimeIR ImportGraph.Shake.DeclDeclNeedsKind.runtimeIR = true
- ImportGraph.Shake.instBEqDeclDeclNeedsKind.beq (ImportGraph.Shake.DeclDeclNeedsKind.comptime a) (ImportGraph.Shake.DeclDeclNeedsKind.comptime b) = (a == b)
- ImportGraph.Shake.instBEqDeclDeclNeedsKind.beq x✝¹ x✝ = false
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- ImportGraph.Shake.instHashableDeclDeclNeedsKind.hash (ImportGraph.Shake.DeclDeclNeedsKind.expr a a_1 a_2) = mixHash (mixHash (mixHash 0 (hash a)) (hash a_1)) (hash a_2)
- ImportGraph.Shake.instHashableDeclDeclNeedsKind.hash (ImportGraph.Shake.DeclDeclNeedsKind.metaIR a a_1) = mixHash (mixHash 1 (hash a)) (hash a_1)
- ImportGraph.Shake.instHashableDeclDeclNeedsKind.hash ImportGraph.Shake.DeclDeclNeedsKind.runtimeIR = 2
- ImportGraph.Shake.instHashableDeclDeclNeedsKind.hash (ImportGraph.Shake.DeclDeclNeedsKind.comptime a) = mixHash 3 (hash a)
Instances For
Equations
- One or more equations did not get rendered due to their size.
- ImportGraph.Shake.instOrdDeclDeclNeedsKind.ord (ImportGraph.Shake.DeclDeclNeedsKind.expr a a_1 a_2) x✝ = Ordering.lt
- ImportGraph.Shake.instOrdDeclDeclNeedsKind.ord x✝ (ImportGraph.Shake.DeclDeclNeedsKind.expr a a_1 a_2) = Ordering.gt
- ImportGraph.Shake.instOrdDeclDeclNeedsKind.ord (ImportGraph.Shake.DeclDeclNeedsKind.metaIR a a_1) x✝ = Ordering.lt
- ImportGraph.Shake.instOrdDeclDeclNeedsKind.ord x✝ (ImportGraph.Shake.DeclDeclNeedsKind.metaIR a a_1) = Ordering.gt
- ImportGraph.Shake.instOrdDeclDeclNeedsKind.ord ImportGraph.Shake.DeclDeclNeedsKind.runtimeIR ImportGraph.Shake.DeclDeclNeedsKind.runtimeIR = Ordering.eq
- ImportGraph.Shake.instOrdDeclDeclNeedsKind.ord ImportGraph.Shake.DeclDeclNeedsKind.runtimeIR x✝ = Ordering.lt
- ImportGraph.Shake.instOrdDeclDeclNeedsKind.ord x✝ ImportGraph.Shake.DeclDeclNeedsKind.runtimeIR = Ordering.gt
- ImportGraph.Shake.instOrdDeclDeclNeedsKind.ord (ImportGraph.Shake.DeclDeclNeedsKind.comptime a) (ImportGraph.Shake.DeclDeclNeedsKind.comptime b) = (compare a b).then Ordering.eq
Instances For
Equations
An English-language description of a DeclDeclNeedsKind.
Equations
- One or more equations did not get rendered due to their size.
- ImportGraph.Shake.DeclDeclNeedsKind.runtimeIR.toMessageData = (Lean.MessageData.ofFormat ∘ Std.format) "used in runtime IR"
- (ImportGraph.Shake.DeclDeclNeedsKind.metaIR isReExported through).toMessageData = (Lean.MessageData.ofFormat ∘ Std.format) "used in meta IR"
- (ImportGraph.Shake.DeclDeclNeedsKind.comptime source).toMessageData = Lean.toMessageData source
Instances For
Equations
- ImportGraph.Shake.DeclDeclNeedsKind.instToMessageData = { toMessageData := fun (x : ImportGraph.Shake.DeclDeclNeedsKind) => x.toMessageData }
some .comptime if this demands the source declaration's IRPhases includes .comptime;
some .runtime if this demands the source declaration's IRPhases includes .runtime. (.all
includes both.) none if there is no demand either way (as is the case for expressions).
Equations
- (ImportGraph.Shake.DeclDeclNeedsKind.expr downstream isReExported upstream).irPhaseNeeds? = none
- (ImportGraph.Shake.DeclDeclNeedsKind.metaIR isReExported through).irPhaseNeeds? = some Lean.IRPhases.comptime
- (ImportGraph.Shake.DeclDeclNeedsKind.comptime source).irPhaseNeeds? = some Lean.IRPhases.comptime
- ImportGraph.Shake.DeclDeclNeedsKind.runtimeIR.irPhaseNeeds? = some Lean.IRPhases.runtime
Instances For
The intrinsic information that determines subsequent placement under different manners of import.
- isPublic : Bool
Whether the declaration is exposed.
noneif the notion of exposure does not apply (e.g. a theorem).Only public declarations can be exposed.
Whether the declaration is meta, i.e. has exported IR.
noneif there is no IR to be exported. Ifsome false, the declaration has runtime IR.- isExact : Bool
A flag indicating whether this is the exact stance (determined within the same module) or a lower bound.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- ImportGraph.Shake.instToStringStance = { toString := fun (x : ImportGraph.Shake.Stance) => x.toString }
A set of declaration needs.
Equations
Instances For
The demands of a single declaration, organized to facilitate movement. Free declarations are those whose modules may change; fixed ones must remain in the same module. Does not record extra mod uses.
- freeDecls : Lean.NameMap DeclDeclNeedsKindSet
Declarations whose location may be altered.
- fixedDecls : Lean.NameMap (Lean.NameMap DeclDeclNeedsKindSet)
Declarations whose location may not be altered. A map
[module name] ↦ [needs of declarations from that module]. The parent declaration, if the ambient declaration is autogenerated.
Any autogenerated declarations used by this declaration.
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- ImportGraph.Shake.instToMessageDataDeclNeed = { toMessageData := fun (x : ImportGraph.Shake.DeclNeed) => x.toMessageData }
Records that the ambient declaration needs the declaration decl at availability k, where
the module of decl is left free.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Records that the ambient declaration needs the imported declaration decl from module i at
availability k, where decl is expected to stay in i.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A collection of needs per declaration.
Instances For
Equations
- needs.toMessageData = ImportGraph.Shake.NameMap.toMessageData✝ needs (fun (x : ImportGraph.Shake.DeclNeed) => x.toMessageData) true
Instances For
Equations
- ImportGraph.Shake.instToMessageDataDeclNeeds = { toMessageData := fun (x : ImportGraph.Shake.DeclNeeds) => x.toMessageData }
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Returns false if s.isExposed = none. Because of that, this is not necessarily equivalent
to !(s.isPrivateAt loc).
Equations
Instances For
Returns false if s.isExposed = none. Because of that, this is not necessarily equivalent
to !(s.isPublicAt loc).
Equations
Instances For
Finds the stance of the given declaration, assuming decl is not imported. Returns none if
decl is either not in the environment or is imported.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Like shouldGenerateCode, but for imported constants.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Approximates the stance of the imported declaration decl by a "lower bound". This means that
we assume that any "extra information" is due to provisioning rather than the stance. For example,
an import all will provide the body of every definition regardless of whether it is exposed or
not. We therefore assume it is not exposed and that import all is doing the work. This allows
us to ensure we have the imports we need. In most cases, however, this lower bound is sharp and
matches the actual stance.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The ImportNeedsKind implied by a downstream constant with stance downstreamStance demanding
a declaration with stance upstreamStance via demand : DeclDeclNeedsKind. Assumes that the
demand is satisfiable by the upstream declaration (e.g. that we are not trying to use an
intrinsically private declaration in a public position).
Note that this does not account for indirect module uses.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- x.run s = StateRefT'.run x s
Instances For
Equations
- x.run' s = StateRefT'.run' x s
Instances For
Gets the stance of the given declaration. Records none if no stance could be found. This is
insensitive to the isExporting flag on the ambient environment.
Equations
- One or more equations did not get rendered due to their size.
Instances For
An approximation to whether something is an autogenerated declaration whose base decl is its prefix. This should be improved.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Calculate the needs of the given declaration based on its ConstInfo (type and value).
Calculate the syntax needs of some syntax, and attaches it as a comptime need for all decls.
This design will likely change in the future, and command needs will have a dedicated location
instead of being duplicated across different declarations.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Calculates the IR needs of a declaration. Currently ignores meta IR.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A warning to display if any new declarations are meta, since meta declarations are not
handled properly yet.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Elaborates the command and captures the DeclNeeds of all new declarations. Attaches the needs
implied by the command's syntax to each new declaration. Also returns the new ExtraModUses
produced during the command. Note: does not capture extra rev mod uses influencing the file as
a whole.
Equations
- One or more equations did not get rendered due to their size.