mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-24 12:14:26 +03:00
16 lines
395 B
Idris
16 lines
395 B
Idris
data MyNat : Type where
|
|
MyZ : MyNat
|
|
MyS : (1 _ : MyNat) -> MyNat
|
|
|
|
lplus : (1 x : MyNat) -> (1 y : MyNat) -> MyNat
|
|
lplus MyZ y = y
|
|
lplus (MyS k) y = MyS (lplus k y)
|
|
|
|
foo : (1 x : MyNat) -> (1 y : MyNat) -> MyNat -> MyNat
|
|
foo x y z
|
|
= let 1 test = the MyNat $ case z of
|
|
MyZ => MyZ
|
|
(MyS k) => MyS z
|
|
in
|
|
lplus test x
|