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=AWL autolearn=disabled version=3.1.3 Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 34B98BC0C for ; Thu, 28 Dec 2006 18:13:29 +0100 (CET) Received: from ipmail02.adl2.internode.on.net (ipmail02.adl2.internode.on.net [203.16.214.141]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id kBSHDQbw018776 for ; Thu, 28 Dec 2006 18:13:28 +0100 Received: from ppp14-213.lns2.syd7.internode.on.net (HELO rosella) ([59.167.14.213]) by ipmail02.adl2.internode.on.net with ESMTP; 29 Dec 2006 03:43:24 +1030 X-IronPort-AV: i="4.12,216,1165152600"; d="scan'208"; a="65429565:sNHT31142818" Subject: Re: [Caml-list] Question on writing efficient Ocaml. From: skaller To: Jon Harrop Cc: caml-list@yquem.inria.fr In-Reply-To: <200612281626.38328.jon@ffconsultancy.com> References: <200612281626.38328.jon@ffconsultancy.com> Content-Type: text/plain Date: Fri, 29 Dec 2006 04:13:21 +1100 Message-Id: <1167326001.5338.0.camel@rosella.wigram> Mime-Version: 1.0 X-Mailer: Evolution 2.6.1 Content-Transfer-Encoding: 7bit X-Miltered: at discorde with ID 4593FB36.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 verbose:01 ocaml:01 optimise:01 sourceforge:01 wrote:01 constructor:01 caml-list:01 int:01 int:01 inefficient:02 declaring:02 types:03 thu:05 efficient:07 On Thu, 2006-12-28 at 16:26 +0000, Jon Harrop wrote: > The code is also needlessly verbose and inefficient. There's no point in > declaring sum types with one contructor: > > type posn = Posn of int * int;; Doesn't Ocaml optimise the constructor away in this case? -- John Skaller Felix, successor to C++: http://felix.sf.net