funmap (f : 'a -> 'b, xs : 'a list) : 'b list =casexsofnil => nil | (y::ys) => (f (y))::(map (f, ys));funzip (xs : 'a list, ys : 'b list) : ('a * 'b) list =case(xs, ys)of(nil, _) => nil | (_, nil) => nil | (b::bs, c::cs) => (b, c)::(zip (bs, cs));funfilter (f : 'a -> bool, xs : 'a list) : 'a list =casexsofnil => nil | (y::ys) =>iff (y)theny::(filter (f, ys))elsefilter (f, ys);funfoldl (f : 'a * 'b -> 'a, n : 'a, xs : 'b list) : 'a =casexsofnil => n | (y::ys) => foldl (f, f (n, y), ys);funupto (x : int, y : int) : int list =ifx <= ythenx::(upto (x + 1, y))elsenil;funsum (xs : int list) : int =casexsofnil => 0 | (x'::xs') => x' + sum (xs');funfold (opr: int*int->int, base: int, xs: int list) : int =casexsofnil => base | (x'::xs') => opr(x', fold(opr, base, xs'));funadd(x,y) = x+y;funfoldsum (xs: int list) = fold (add,0, xs);funfoldr (opr: 'b*'a->'a, base: 'a, xs: 'b list) : 'a =casexsofnil => base | (x'::xs') => opr(x', foldr(opr, base, xs'));