Idris2/tests/codegen/builtin001/Main.idr
Zoe Stafford c75b3f7f14
Add Agda-like builtins (#1253)
Co-authored-by: Guillaume ALLAIS <guillaume.allais@ens-lyon.org>
2021-04-22 13:08:32 +01:00

14 lines
229 B
Idris

data Natural : Type where
S : Natural -> Natural
Z : Natural
%builtin Natural Natural
plus : Natural -> Natural -> Natural
plus Z y = y
plus (S x) y = S (plus x y)
main : IO Natural
main = pure $ plus (S Z) (S $ S Z)