mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-20 18:21:47 +03:00
10 lines
153 B
Idris
10 lines
153 B
Idris
data MyNat
|
|
= Z
|
|
| S MyNat MyNat
|
|
|
|
natToInt : MyNat -> Integer
|
|
natToInt Z = 0
|
|
natToInt (S k _) = 1 + natToInt k
|
|
|
|
%builtin NaturalToInteger natToInt
|