mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-16 15:52:43 +03:00
10 lines
145 B
Idris
10 lines
145 B
Idris
data MyNat
|
|
= Z
|
|
| S MyNat
|
|
|
|
natToInt : MyNat -> Integer
|
|
natToInt Z = 0
|
|
natToInt (S k) = 1 + natToInt k
|
|
|
|
%builtin NaturalToInteger natToInt
|