Idris2/tests/idris2/builtin006/Test.idr

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