mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-30 07:02:24 +03:00
c75b3f7f14
Co-authored-by: Guillaume ALLAIS <guillaume.allais@ens-lyon.org>
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)
|