module Product; // Already defined! // let rec foldr f b xs = match xs with // | [] -> b // | (x::xs) -> f x (foldr f b xs) // ;; // let product ms ns = foldr (fun m ps -> foldr (fun n xs -> (m,n)::xs) ps ns) [] ms;; def List> productP(List ms, List ns) = foldr((A m, List ps) => foldr((B n, List xs) => Cons(Pair(m,n), xs))(ps, ns))(Nil, ms); def List> start(List ms, List ns) = productP(ms,ns); { }