I'm trying to declare a function takelist : 'a list list -> int -> 'a list, so that calling takelist xs n will return the elements in spot number n in the lists from xs.
takelist [[#"3", #"6"], [#"6", #"2"], [#"5", #"9"]] 1;
should return [#"6", #"2", #"9"].
This is what I have:
fun tagliste (x::xs) n = List.nth(x,n);
I does half of what I want, and I can't figure how to get everything. I'm just getting the n from the first list instead of all of them. I've been told that map will be able to help, but so far I haven't had any luck using it correctly.
Any help is appreciated!