From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id F1166BC69 for ; Mon, 5 Mar 2007 09:37:46 +0100 (CET) Received: from ipmail03.adl2.internode.on.net (ipmail03.adl2.internode.on.net [203.16.214.135]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l258bi0H022401 for ; Mon, 5 Mar 2007 09:37:46 +0100 Received: from ppp19-103.lns2.syd7.internode.on.net (HELO [192.168.1.201]) ([59.167.19.103]) by ipmail03.adl2.internode.on.net with ESMTP; 05 Mar 2007 19:07:42 +1030 X-IronPort-AV: i="4.14,248,1170595800"; d="scan'208"; a="58047234:sNHT1482495364" Subject: Re: [Caml-list] to merge list of lists From: skaller To: Pietro Abate Cc: ocaml ml In-Reply-To: <20070305061050.GA21256@pulp.rsise.anu.edu.au> References: <20070305061050.GA21256@pulp.rsise.anu.edu.au> Content-Type: text/plain Date: Mon, 05 Mar 2007 19:37:39 +1100 Message-Id: <1173083859.25568.47.camel@rosella.wigram> Mime-Version: 1.0 X-Mailer: Evolution 2.8.1 Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 45EBD6D8.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; sourceforge:01 wrote:01 caml-list:01 int:01 overly:02 concat:03 library:03 written:07 function:08 function:08 looks:08 john:09 felix:09 felix:09 complicated:09 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 Felix, successor to C++: http://felix.sf.net