-
Notifications
You must be signed in to change notification settings - Fork 450
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat:
pp.numeralTypes
option for printing number literals with type…
… 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`.
- Loading branch information
Showing
4 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
set_option pp.numeralTypes true | ||
|
||
#check (17 : Fin 22) | ||
|
||
-- Doesn't apply to nat literals | ||
#check nat_lit 2 | ||
|
||
#check 2 | ||
|
||
#check 2 + 1 = 3 | ||
|
||
set_option pp.all true | ||
|
||
#check 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
(17 : Fin (22 : Nat)) : Fin (22 : Nat) | ||
2 : Nat | ||
(2 : Nat) : Nat | ||
(2 : Nat) + (1 : Nat) = (3 : Nat) : Prop | ||
@OfNat.ofNat.{0} Nat 2 (instOfNatNat 2) : Nat |