-
Notifications
You must be signed in to change notification settings - Fork 451
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: pp.numericTypes
option for printing number literals with type ascriptions
#2933
Conversation
|
I am a bit concerned about the name |
Sebastian suggested that we go through the RFC process for this, so I'll put this back to draft and we can discuss these issues on Zulip. |
b5a85ef
to
8eed687
Compare
pp.numeralTypes
option for printing number literals with type ascriptionspp.numericTypes
option for printing number literals with type ascriptions
I'm re-opening this now that it's implementing an RFC. Something I checked by hand is that the delaborators ensure that each subexpression is still hoverable in the infoview. |
8eed687
to
fb25a2d
Compare
fb25a2d
to
c5d6d51
Compare
This looks good.
|
@semorrison I added a RELEASES entry. Regarding the RFC, I'm planning on eventually going through the RFCs I've written and copying the explanations to relevant parts of the docs (in future PRs). |
… ascriptions This was a pretty printer option in the Lean 3 community edition, and it was useful for debugging how arithmetic expressions elaborated or have been otherwise transformed. For example, the real numbers have two exponentiation operations (Real -> Real -> Real and Real -> Nat -> Real) and it is helpful knowing at a glance which of these is `x ^ 2`. Closes leanprover#3021
469be42
to
c54c69f
Compare
Implements the pretty printer option
pp.numericTypes
for including a type ascription for numeric literals. For example,(2 : Nat)
,(-2 : Int)
, and(-2 / 3 : Rat)
. This is useful for debugging how arithmetic expressions have elaborated or have been otherwise transformed. For example, with exponentiation is is helpful knowing whether it isx ^ (2 : Nat)
orx ^ (2 : Real)
. This is like the Lean 3 optionpp.numeralTypes
but it has a wider notion of a numeric literal.Also implements the pretty printer option
pp.natLit
for including thenat_lit
prefix for raw natural number literals.Closes #3021