Idris2-boot/sample/Nat.yaff
Edwin Brady 63da191e03 FOUR!!!1!!!
Er, that is to say, evaluation of a 'main' expression
'plus (S (S Z)) (S (S Z))' is now printing the right answer.
2019-04-20 16:54:09 +01:00

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))