(* These are alternative solutions to problem 4 (by two 330 students) * Thanks to Matthew Barr and Rob Kiefer! *) (* by Matthew Barr *) let rec unzip1 l = match l with [] -> ([],[]) | (h1,h2)::t -> match (unzip1 t) with (t1,t2) -> (h1::t1, h2::t2);; (* by Rob Kiefer *) let rec unzip2 l = match l with [] -> ([],[]) | ((a,b)::t) -> let x = unzip2 t in let split (c,d) (x,y) = (c::x, d::y) in split (a,b) (x);;