mirror of
https://github.com/edwinb/Idris2-boot.git
synced 2024-12-01 06:12:57 +03:00
63da191e03
Er, that is to say, evaluation of a 'main' expression 'plus (S (S Z)) (S (S Z))' is now printing the right answer.
11 lines
169 B
Plaintext
11 lines
169 B
Plaintext
data Nat : Type where
|
|
Z : Nat
|
|
S : Nat -> Nat
|
|
|
|
plus : Nat -> Nat -> Nat
|
|
plus Z $y = y
|
|
plus (S $k) $y = S (plus k y)
|
|
|
|
main : Nat
|
|
main = plus (S (S Z)) (S (S Z))
|