Merge pull request #463 from plfa/zachrbrown-dev
Minor changes to fix #460
This commit is contained in:
commit
1c06cd319d
1 changed files with 4 additions and 5 deletions
|
@ -239,11 +239,10 @@ Including the line
|
|||
```
|
||||
tells Agda that `ℕ` corresponds to the natural numbers, and hence one
|
||||
is permitted to type `0` as shorthand for `zero`, `1` as shorthand for
|
||||
`suc zero`, `2` as shorthand for `suc (suc zero)`, and so on. The
|
||||
declaration is not permitted unless the type given has exactly two
|
||||
constructors, one with no arguments (corresponding to zero) and
|
||||
one with a single argument of the same type given in the pragma
|
||||
(corresponding to successor).
|
||||
`suc zero`, `2` as shorthand for `suc (suc zero)`, and so on. The pragma
|
||||
must be given a previously declared type (in this case `ℕ`) with
|
||||
precisely two constructors, one with no arguments (in this case `zero`),
|
||||
and one with a single argument of the given type (in this case `suc`).
|
||||
|
||||
As well as enabling the above shorthand, the pragma also enables a
|
||||
more efficient internal representation of naturals using the Haskell
|
||||
|
|
Loading…
Reference in a new issue