Idris2/tests/idris2/builtin/builtin006/Test.idr
2023-09-07 14:57:22 +01:00

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