caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Thomas.Gazagnaire@inria.fr
To: "ben kuin" <benkuin@gmail.com>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] why is the forward pipe operator (>|) so little  used?
Date: Sun, 3 Oct 2010 16:15:45 +0200 (CEST)	[thread overview]
Message-ID: <38105.216.36.86.169.1286115345.squirrel@imap-sop.inria.fr> (raw)
In-Reply-To: <1595278357.2147341.1286043752455.JavaMail.root@zmbs4.inria.fr>

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
>


       reply	other threads:[~2010-10-03 14:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1595278357.2147341.1286043752455.JavaMail.root@zmbs4.inria.fr>
2010-10-03 14:15 ` Thomas.Gazagnaire [this message]
2010-10-03 15:57   ` Yaron Minsky
2010-10-02 18:22 ben kuin
2010-10-02 22:45 ` [Caml-list] " Hezekiah M. Carty

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=38105.216.36.86.169.1286115345.squirrel@imap-sop.inria.fr \
    --to=thomas.gazagnaire@inria.fr \
    --cc=benkuin@gmail.com \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).