(* Original calculator from Week7, enhanced with Booleans and Immutable Pairs *)
type term =
- Intconstant of int
- | Multiplication of (term * term)
- | Addition of (term * term)
- | Variable of char
- | Let of (char * term * term)
- | Iszero of term
- | If of (term * term * term)
- | Makepair of (term * term)
- | First of term
- ;;
+ Intconstant of int
+ | Multiplication of (term * term)
+ | Addition of (term * term)
+ | Variable of char
+ | Let of (char * term * term)
+ | Iszero of term
+ | If of (term * term * term)
+ | Makepair of (term * term)
+ | First of term
+ ;;
type expressed_value = Int of int | Bool of bool | Pair of expressed_value * expressed_value;;
type bound_value = expressed_value;;