mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-25 04:33:45 +03:00
14 lines
229 B
Idris
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)
|