diff options
| author | Pierre Letouzey | 2017-02-27 12:30:51 +0100 |
|---|---|---|
| committer | Jason Gross | 2018-08-31 20:05:53 -0400 |
| commit | f3d18836471ced1244922430df4195f79b347a7c (patch) | |
| tree | c87c461b9a520bab0422eb95940eb784f1801259 /plugins/syntax/NatSyntaxViaZ.v | |
| parent | b786723fe7aff0c58ac949d44a356e2df6805645 (diff) | |
Numeral Notation: misc code improvements (records, subfunctions, exceptions ...)
Diffstat (limited to 'plugins/syntax/NatSyntaxViaZ.v')
| -rw-r--r-- | plugins/syntax/NatSyntaxViaZ.v | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/plugins/syntax/NatSyntaxViaZ.v b/plugins/syntax/NatSyntaxViaZ.v index adee347d90..8a4d8f236d 100644 --- a/plugins/syntax/NatSyntaxViaZ.v +++ b/plugins/syntax/NatSyntaxViaZ.v @@ -44,13 +44,14 @@ Definition Z_succ x := end end. -Fixpoint Z_of_nat_loop n := +Fixpoint Z_of_nat n := match n with | O => Z0 - | S p => Z_succ (Z_of_nat_loop p) + | S p => Z_succ (Z_of_nat p) end. -Definition Z_of_nat n := Some (Z_of_nat_loop n). +(** The 1st conversion must either have type [Z->nat] or [Z->option nat]. + The 2nd one must either have type [nat->Z] or [nat->option Z]. *) Numeral Notation nat nat_of_Z Z_of_nat : nat_scope (warning after 5000). |
