Arith.agda 463 B

12345678910111213141516171819202122232425
  1. module Arith where
  2. open import Common.IO
  3. open import Common.Nat renaming (_∸_ to _-_) -- workaround for #1855
  4. open import Common.Unit
  5. test : Nat
  6. test = 4
  7. foobar : Nat -> Nat
  8. foobar zero = zero
  9. foobar (suc n) = suc (suc n)
  10. main : IO Unit
  11. main =
  12. -- n <- readNat ,
  13. printNat 0 ,,
  14. printNat (0 + 1) ,,
  15. printNat (1 * 2) ,,
  16. printNat (suc (suc (suc (suc zero))) - suc zero) ,,
  17. printNat test ,,
  18. printNat (foobar 4) ,,
  19. -- printNat n ,,
  20. return unit