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=1.4 required=5.0 tests=SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 336B5BC69 for ; Wed, 7 Mar 2007 15:33:14 +0100 (CET) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.174]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l27EXDm0003803 for ; Wed, 7 Mar 2007 15:33:13 +0100 Received: by ug-out-1314.google.com with SMTP id q2so620699uge for ; Wed, 07 Mar 2007 06:33:13 -0800 (PST) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Mu0V+H+fmP+3Byw8g3gMqen2t2T/6ma5pIqgZc2GFOHKnr20Og837QF0T+Fc+Or0gP8A+UUKG6X5Qd4Frje6thdGFkW4Lgc1bxNjJ0Mx/Q06Tjc65CKY+9l9ueRL2ZOIU2GQhGr8Gdv2AWNQsjXolWmobrYLBtNqMjnjddy5o+Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=cI3Cj3mktCr0avaeC3xzB2dbJ4ICTqg7YXgn8q6ZWyaLdOU35ug8x7LuEvvJ/PC4BhxNMdHfsIG1bWH74IewEXx7i4jbBP9EQumfrH4OrJ99aBl4RvM8dHHoVXqxFfhpmGNunjNqoywMz/SCZwNjOPGxdNBIaGbDQbt83TcRgLE= Received: by 10.114.81.1 with SMTP id e1mr2161426wab.1173277992455; Wed, 07 Mar 2007 06:33:12 -0800 (PST) Received: by 10.114.131.8 with HTTP; Wed, 7 Mar 2007 06:33:12 -0800 (PST) Message-ID: Date: Wed, 7 Mar 2007 15:33:12 +0100 From: "Roland Zumkeller" To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] to merge list of lists In-Reply-To: <200703050853.12223.jon@ffconsultancy.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20070305061050.GA21256@pulp.rsise.anu.edu.au> <1173083859.25568.47.camel@rosella.wigram> <200703050853.12223.jon@ffconsultancy.com> X-j-chkmail-Score: MSGID : 45EECD29.001 on discorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at discorde with ID 45EECD29.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; lix:01 wrote:01 rec:01 rec:01 exception:01 caml-list:01 quadratic:02 slightly:03 let:03 let:03 raises:05 version:13 roland:85 roland:85 www:84 On 05/03/07, Jon Harrop wrote: > # let rec transpose list = > try map hd list :: transpose (map tl list) with _ -> [];; Here is a slightly different version that raises an exception if the given list is not quadratic: let rec transpose xs = if for_all ((=) []) xs then [] else map hd xs :: transpose (map tl xs);; -- http://www.lix.polytechnique.fr/~zumkeller/