mirror of
https://github.com/idris-lang/Idris2.git
synced 2025-01-05 15:08:00 +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
|