caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Yotam Barnoy <yotambarnoy@gmail.com>
To: Martin DeMello <martindemello@gmail.com>
Cc: Nils Becker <nils.becker@bioquant.uni-heidelberg.de>,
	 "caml-list@inria.fr" <caml-list@inria.fr>
Subject: Re: [Caml-list] pipe input short syntax idea
Date: Sat, 10 Oct 2015 21:31:04 -0400	[thread overview]
Message-ID: <CAN6ygOnUsKv25dXxarzhWb2kyRcfLwi10DFrNGohyP6JP=Bgew@mail.gmail.com> (raw)
In-Reply-To: <CAFrFfuH1Dad50E6xW7bDU22WKQuUUq6jLO2gDua5HXvr=ScOwQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1444 bytes --]

Interesting, but seems like overkill to me personally. I'm ok with @@ and
|> (which already breaks F#'s convention, since @@ would be <| in F#.
What's the reason we went with @@ instead again?). Function composition is
potentially more confusing, and I think keeping it with a consistent
associativity direction (that being the direction of normal function
application from right to left) has value. So I'm personally sort-of ok
with <<, but once you suggest something as beautifully concise as o, I'm
overwhelmed by the convenience factor.

On Sat, Oct 10, 2015 at 9:09 PM, Martin DeMello <martindemello@gmail.com>
wrote:

> F# defines composition operators >> and <<:
>
> http://theburningmonk.com/2011/09/fsharp-pipe-forward-and-pipe-backward/
>
> martin
>
> On Sat, Oct 10, 2015 at 6:52 AM, Nils Becker <
> nils.becker@bioquant.uni-heidelberg.de> wrote:
>
>> hi,
>>
>> just an idea for a short notation which might be appealing:
>>
>> (|> f |> g |> ... ) as abbreviation for (fun x -> x |> f |> g |> ...)
>>
>> (|> f) would be just f.
>>
>> in other words a it's function composition using |> . it looks intuitive
>> to me. but of course it could be a bad idea for a lot of reasons.
>>
>> n,
>>
>>
>> --
>> Caml-list mailing list.  Subscription management and archives:
>> https://sympa.inria.fr/sympa/arc/caml-list
>> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
>> Bug reports: http://caml.inria.fr/bin/caml-bugs
>>
>
>

[-- Attachment #2: Type: text/html, Size: 2782 bytes --]

  reply	other threads:[~2015-10-11  1:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-10 13:52 Nils Becker
2015-10-10 14:11 ` octachron
2015-10-11  0:19   ` Yotam Barnoy
2015-10-11  0:56     ` Ian Zimmerman
2015-10-11  1:01       ` Yotam Barnoy
2015-10-11  1:09 ` Martin DeMello
2015-10-11  1:31   ` Yotam Barnoy [this message]
2015-10-11  8:36     ` Petter A. Urkedal

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='CAN6ygOnUsKv25dXxarzhWb2kyRcfLwi10DFrNGohyP6JP=Bgew@mail.gmail.com' \
    --to=yotambarnoy@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=martindemello@gmail.com \
    --cc=nils.becker@bioquant.uni-heidelberg.de \
    /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).