4 datatype nat = Suc of nat | Zero_nat;
6 fun eqop_nat Zero_nat Zero_nat = true
7 | eqop_nat (Suc m) (Suc n) = eqop_nat m n
8 | eqop_nat Zero_nat (Suc a) = false
9 | eqop_nat (Suc a) Zero_nat = false;
16 fun null (x :: xs) = false
19 fun list_all2 p (x :: xs) (y :: ys) = p x y andalso list_all2 p xs ys
20 | list_all2 p xs [] = null xs
21 | list_all2 p [] ys = null ys;
28 datatype monotype = Mono of Nat.nat * monotype list;
30 fun eqop_monotype (Mono (tyco1, typargs1)) (Mono (tyco2, typargs2)) =
31 Nat.eqop_nat tyco1 tyco2 andalso
32 List.list_all2 eqop_monotype typargs1 typargs2;
34 end; (*struct Codegen*)