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 C17CCBC57 for ; Sun, 3 Oct 2010 17:57:15 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AusDADNEqExKfVK2kGdsb2JhbACUBYYaAYgYCBUBAQEBCQkMBxEDH6YpiUkKgg2FWC6IVgEBAwWFQgSBXYhjg0aEXA X-IronPort-AV: E=Sophos;i="4.57,275,1283724000"; d="scan'208";a="60011721" Received: from mail-wy0-f182.google.com ([74.125.82.182]) by mail3-smtp-sop.national.inria.fr with ESMTP; 03 Oct 2010 17:57:15 +0200 Received: by wyb29 with SMTP id 29so3777130wyb.27 for ; Sun, 03 Oct 2010 08:57:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:reply-to :in-reply-to:references:date:message-id:subject:from:to:cc :content-type; bh=Yr+eKlWaMXCl9e28MWW+p6erMYNR2b6R2bVGNoP4678=; b=NWfRal66sqVjq3BKAlHgau2Naj7JKAMxTob+mL0RYD0o2OABgzC4QqBEW4fRRHlCnP Wa4uwNiUNGAxr1hv+/I5KpafTVtPx1LlEkSW6gPSODwoqMM7zL6hZo6kKyLzAHvmgdYe HAVndzHHaDr63p+sMmqh9dklDJuQrNwP+Yt58= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; b=OoNIQvW+9e0FPqGpOnz112T6D7EvVLngtI8h7cIjPcLB7yO3+nylBl+D1Cp1TTnYS+ G6gvsj6x3ilVq0D1SGu6ing7N/6skYJ1Vap/JKnU2K8L4tNlyMhzaxJDfZRXCEa6fcnd HRyRjSFYnoILacdr1iZ+SQ0qaBgJb7L3waznw= MIME-Version: 1.0 Received: by 10.216.236.149 with SMTP id w21mr6654257weq.65.1286121434952; Sun, 03 Oct 2010 08:57:14 -0700 (PDT) Received: by 10.216.46.143 with HTTP; Sun, 3 Oct 2010 08:57:14 -0700 (PDT) Reply-To: yminsky@gmail.com In-Reply-To: <38105.216.36.86.169.1286115345.squirrel@imap-sop.inria.fr> References: <1595278357.2147341.1286043752455.JavaMail.root@zmbs4.inria.fr> <38105.216.36.86.169.1286115345.squirrel@imap-sop.inria.fr> Date: Sun, 3 Oct 2010 11:57:14 -0400 Message-ID: Subject: Re: [Caml-list] why is the forward pipe operator (>|) so little used? From: Yaron Minsky To: Thomas.Gazagnaire@inria.fr Cc: ben kuin , caml-list@inria.fr Content-Type: multipart/alternative; boundary=000e0cd4024a44b60b0491b87b90 X-Spam: no; 0.00; yaron:01 minsky:01 yminsky:01 elt:01 elt:01 ocaml:01 ocaml:01 beginner's:01 bug:01 beginner's:01 bug:01 blog:98 blog:98 beginners:01 beginners:01 --000e0cd4024a44b60b0491b87b90 Content-Type: text/plain; charset=ISO-8859-1 For what it's worth, at Jane Street, we use it all the time (although we spell it |!, not |>). Not for intellisense, but because it makes certain kinds of transformation code easier to understand. y On Sun, Oct 3, 2010 at 10:15 AM, wrote: > 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 > > > > _______________________________________________ > 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 > --000e0cd4024a44b60b0491b87b90 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable For what it's worth, at Jane Street, we use it all the time (although w= e spell it |!, not |>).=A0 Not for intellisense, but because it makes ce= rtain kinds of transformation code easier to understand.

y

On Sun, Oct 3, 2010 at 10:15 AM, <Thomas.Gazagnaire@inria.fr> wrote:=
I believe it is considered as good practice in F# to use the forward type operator, only because of visual-studio "intellisense", ie. tab c= ompletion
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 =A0up on blogposts or on
> stackoverflow, its =A0presented as a special F# feature.
> In the Ocaml world the pipe doesn't have a special place. I doesn&= #39;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.<= br> > 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.<= br> > But obviously the proficient Ocaml folks don't use it - could some= one
> 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://ca= ml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports:
http://caml.inria.fr/bin/caml-bugs
>

_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.in= ria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

--000e0cd4024a44b60b0491b87b90--