Browse thread
to merge list of lists
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | skaller <skaller@u...> |
| Subject: | Re: [Caml-list] to merge list of lists |
On Mon, 2007-03-05 at 17:10 +1100, Pietro Abate wrote: > Hi all, > I want to write a small function to merge a list of lists > > mergel [] [[1;2;3];[4;5;6];[7;8;9]];; > - : int list list = [[1; 4; 7]; [2; 5; 8]; [3; 6; 9]] > > I've written it down, but to me, it looks overly complicated : > I always feel that when solving these kind of problems I miss some > greater truth ... In this case there is a library function: List.concat that already does exactly what you want :) -- John Skaller <skaller at users dot sf dot net> Felix, successor to C++: http://felix.sf.net