From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 65B74BB81 for ; Fri, 24 Feb 2006 20:05:06 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id k1OJ55fY018873 for ; Fri, 24 Feb 2006 20:05:05 +0100 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id UAA08721 for ; Fri, 24 Feb 2006 20:05:03 +0100 (MET) Received: from fork.recoil.org (fork.recoil.org [194.70.3.132]) by concorde.inria.fr (8.13.0/8.13.0) with SMTP id k1OJ52kU018865 for ; Fri, 24 Feb 2006 20:05:02 +0100 Received: (qmail 5150 invoked by uid 10000); 24 Feb 2006 19:05:01 -0000 Date: Fri, 24 Feb 2006 19:05:01 +0000 From: Anil Madhavapeddy To: Alessandro Baretta Cc: Ocaml Subject: Re: [Caml-list] Question on performance/style issue Message-ID: <20060224190501.GA27740@fork.recoil.org> References: <43FF2BC9.6030503@studio.baretta.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <43FF2BC9.6030503@studio.baretta.com> User-Agent: Mutt/1.5.11 X-Miltered: at concorde with ID 43FF58E1.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 43FF58DE.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; anil:01 anil:01 caml-list:01 baretta:01 computations:01 bindings:01 ocaml:01 caml-list:01 wrote:01 caml:02 programming:03 alessandro:03 let:03 let:03 complex:04 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 On Fri, Feb 24, 2006 at 04:52:41PM +0100, Alessandro Baretta wrote: > I am very fond of the following "duality" operator. > > let (++) x f = f x > > I use to write complex computations legibly: instead of > > h(g(f(x))) > I write > > x ++ f ++ g ++ h > > What is the impact of the this programming style on execution performance? >>From a GC point of view, this is better than the alternative of splitting up the calls into separate let bindings. It's used in the OCaml sources to make some long call-chains look nicer. To reference the original post... http://caml.inria.fr/pub/ml-archives/caml-list/2003/09/825011113899cde2b1b96cf7fc7a0f7b.en.html -- Anil Madhavapeddy http://anil.recoil.org University of Cambridge http://www.cl.cam.ac.uk