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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 5ACBEBC6B for ; Mon, 17 Sep 2007 20:58:24 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAABZr7kbAXQImk2dsb2JhbACBWIw9AgcEBgcg X-IronPort-AV: E=Sophos;i="4.20,265,1186351200"; d="scan'208";a="2827798" Received: from discorde.inria.fr ([192.93.2.38]) by mail3-smtp-sop.national.inria.fr with ESMTP; 17 Sep 2007 20:59:24 +0200 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l8HIwl8G027551 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Mon, 17 Sep 2007 20:58:50 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAABZr7kaAArkpjGdsb2JhbACBWIw9CQQGBwYa X-IronPort-AV: E=Sophos;i="4.20,265,1186351200"; d="scan'208";a="927404" Received: from chokecherry.srv.cs.cmu.edu ([128.2.185.41]) by mail1-smtp-roc.national.inria.fr with ESMTP; 17 Sep 2007 20:59:20 +0200 Received: from stratocaster.home (c-71-206-252-35.hsd1.pa.comcast.net [71.206.252.35]) (authenticated bits=0) by chokecherry.srv.cs.cmu.edu (8.13.6/8.13.6) with ESMTP id l8HIxB5w021553 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO) for ; Mon, 17 Sep 2007 14:59:11 -0400 (EDT) Received: from ecc by stratocaster.home with local (Exim 4.67) (envelope-from ) id 1IXLoN-0005be-CU for caml-list@inria.fr; Mon, 17 Sep 2007 14:59:11 -0400 Date: Mon, 17 Sep 2007 14:59:11 -0400 From: Eric Cooper To: caml-list@inria.fr Subject: Re: [Caml-list] Having '<<', why to use '|>' ? Message-ID: <20070917185911.GB21078@stratocaster.home> Mail-Followup-To: caml-list@inria.fr References: <20070917163617.0e6e0e7c@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070917163617.0e6e0e7c@localhost.localdomain> User-Agent: Mutt/1.5.16 (2007-06-11) X-Miltered: at discorde with ID 46EECE67.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; 0200,:01 pipelines:01 wrote:01 unix:01 caml-list:01 functional:02 tend:03 let:03 let:03 shell:04 passing:05 exists:05 style:93 sep:06 arguments:07 On Mon, Sep 17, 2007 at 04:36:17PM +0200, Fabrice Marchant wrote: > let ( << ) f g x = f (g x) > let ( |> ) x f = f x > I usually use '<<' and wonder if we can always supersede '|>' by > this operator ? Does it exists a case where the use of '|>' is > better ? I think it's just a matter of style. Your |> operator lets you write "pipelines" similar to the Unix shell, in which evaluation flows from left to right. I've typically used this when I'm applying the function to all its arguments. I tend to use the traditional composition operator (your <<), when I'm combining and passing functional values around. -- Eric Cooper e c c @ c m u . e d u