Given a list of tuples,
[(1,2),(3,4),(5,6)]
I need to unzip it to look like this
[[1,3,5],[2,4,6]]
unzip needs to be of type ('a * 'a) list -> 'a list list
.
So far, I have this as my unzip function but my input is incorrect, and I am not sure how to access pass through ('a * 'a).
val rec last =
fn (h::nil) => h
|(h::list) => last (list)
| (nil) => raise Empty;
fun unzip [] = []
| unzip L = [(map hd L), (map last L)];
this returns 'a list list -> 'a list list