The where
command
When working in a Lean file with namespaces, parameters, and variables, it can be confusing to
identify what the current "parser context" is. The command #where
identifies and prints
information about the current location, including the active namespace, open namespaces, and
declared variables.
It is a bug for #where
to incorrectly report this information (this was not formerly the case);
please file an issue on GitHub if you observe a failure.
Assigns a priority to each binder for determining the order in which variables are traced.
The relation on binder priorities.
Selects the elements of the given list α
which under the image of p : α → β × γ
have β
component equal to b'
. Returns the γ
components of the selected elements under the image of p
,
and the elements of the original list α
which were not selected.
Equations
- where.select_for_which p b' (a :: rest) = where.select_for_which._match_2 p b' a (where.select_for_which p b' rest)
- where.select_for_which p b' list.nil = (list.nil γ, list.nil α)
- where.select_for_which._match_2 p b' a (cs, others) = where.select_for_which._match_1 b' a cs others (p a)
- where.select_for_which._match_1 b' a cs others (b, c) = ite (b = b') (c :: cs, others) (cs, a :: others)
Returns the elements of l
under the image of p
, collecting together elements with the same
β
component, deleting duplicates.
Sort the variables by their priority as defined by where.binder_priority
.
Format an individual variable definition for printing.
Turn a list of triples of variable names, binder info, and types, into a pretty list.
#where
output helper which traces the current namespace.
#where
output helper which traces the open namespaces.
#where
output helper which traces the variables.
#where
output helper which traces the includes.
#where
output helper which traces the namespace end.
When working in a Lean file with namespaces, parameters, and variables, it can be confusing to
identify what the current "parser context" is. The command #where
identifies and prints
information about the current location, including the active namespace, open namespaces, and
declared variables.
It is a bug for #where
to incorrectly report this information (this was not formerly the case);
please file an issue on GitHub if you observe a failure.