4 datatype nat = Suc of nat | Zero_nat;
6 fun eq_nat (Suc a) Zero_nat = false
7 | eq_nat Zero_nat (Suc a) = false
8 | eq_nat (Suc nat) (Suc nat') = eq_nat nat nat'
9 | eq_nat Zero_nat Zero_nat = true;
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 eq_monotype (Mono (tyco1, typargs1)) (Mono (tyco2, typargs2)) =
31 Nat.eq_nat tyco1 tyco2 andalso
32 List.list_all2 eq_monotype typargs1 typargs2;
34 end; (*struct Codegen*)