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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id BDEDFBC57 for ; Sun, 3 Oct 2010 16:15:45 +0200 (CEST) From: Thomas.Gazagnaire@inria.fr X-IronPort-AV: E=Sophos;i="4.57,275,1283724000"; d="scan'208";a="60002319" Received: from imap1-sop.inria.fr ([138.96.0.111]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/ADH-AES256-SHA; 03 Oct 2010 16:15:45 +0200 Received: by imap1-sop.inria.fr (Postfix, from userid 48) id 8D06039981AC; Sun, 3 Oct 2010 16:15:45 +0200 (CEST) Received: from 216.36.86.169 (SquirrelMail authenticated user tgazagna) by imap-sop.inria.fr with HTTP; Sun, 3 Oct 2010 16:15:45 +0200 (CEST) Message-ID: <38105.216.36.86.169.1286115345.squirrel@imap-sop.inria.fr> In-Reply-To: <1595278357.2147341.1286043752455.JavaMail.root@zmbs4.inria.fr> References: <1595278357.2147341.1286043752455.JavaMail.root@zmbs4.inria.fr> Date: Sun, 3 Oct 2010 16:15:45 +0200 (CEST) Subject: Re: [Caml-list] why is the forward pipe operator (>|) so little used? To: "ben kuin" Cc: caml-list@inria.fr User-Agent: SquirrelMail/1.4.8-5.el5_4.10 MIME-Version: 1.0 Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Spam: no; 0.00; elt:01 elt:01 ocaml:01 ocaml:01 beginner's:01 bug:01 blog:98 beginners:01 imho:01 imho:01 caml-list:01 caml-list:01 bin:01 caml:02 caml:02 I believe it is considered as good practice in F# to use the forward type operator, only because of visual-studio "intellisense", ie. tab completion using types information available at write-time. So suppose you a variable x already typed in your environment, if you write : $ x |> map (fun elt -> elt. at this point visual studio can infer the type of elt and show to the programmer which 'methods' he can call on it. if you do the normal way, you can't infer the type of elt at write-time. imho, the impact on style and readability is only a fortunate side-effect :-) -- Thomas > hi > Reading a few introduction F# articles and presentations I made the > observation that the forward pipe operator is widely popular. Its also > a language feature that, when it comes up on blogposts or on > stackoverflow, its presented as a special F# feature. > In the Ocaml world the pipe doesn't have a special place. I doesn't > come up in any of the Ocaml Books (print or pdf) and hardly any > internet articles or blog posts. For example Jon Harrop mentions the > pipe in one of his F# books but not in the Ocaml for Scientists book. > Looking at the mentioned F# code, I think the usage of the pipe has an > ( imho positive) impact on the style and the readability of the code. > But obviously the proficient Ocaml folks don't use it - could someone > may explain the reason(s)? > thanks > ben > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs >