write-you-a-haskell/chapter3/calc
2015-06-10 13:23:49 -04:00
..
calc.cabal Added transformers to cabal file. 2015-01-18 03:57:47 +01:00
Eval.hs chapter3/calc/Eval.hs: avoid recomputation of normal form in eval 2015-01-30 20:23:57 +01:00
Main.hs initial commit 2015-01-05 02:54:15 -05:00
Parser.hs "Infix" --> "Prefix" in comment 2015-06-10 13:23:49 -04:00
Pretty.hs There is no Type module to import. 2015-01-18 03:40:22 +01:00
README.md initial commit 2015-01-05 02:54:15 -05:00
Syntax.hs initial commit 2015-01-05 02:54:15 -05:00

Arith

A untyped arithmetic.

To compile and run:

$ cabal run

Usage:

Arith> succ 0
succ 0

Arith> succ (succ 0)
succ (succ 0)

Arith> if false then true else false
false

Arith> iszero (pred (succ (succ 0)))
false

Arith> pred (succ 0)
0

Arith> iszero false
Cannot evaluate

Arith> if 0 then true else false
Cannot evaluate

License

Released under MIT license.