caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Elias Gabriel Amaral da Silva <tolkiendili@gmail.com>
To: David House <dmhouse@gmail.com>
Cc: ben kuin <benkuin@gmail.com>, caml-list@inria.fr
Subject: Re: [Caml-list] what do I need to know to understand camlp4
Date: Mon, 27 Sep 2010 08:43:28 -0300	[thread overview]
Message-ID: <AANLkTik0dfcb1mKa-My9DWz6ggBn-xL21XExX69+Aopt@mail.gmail.com> (raw)
In-Reply-To: <AANLkTin0JyYTJ_WLk2x27RQU7JNEAXvwDkO8OQzM-Pw9@mail.gmail.com>

2010/9/24 David House <dmhouse@gmail.com>:

> Incidentally, ($) in Haskell is right-associative; however the
> consensus in the Haskell community (in my experience) is that this is
> a mistake. If it were left-associative, you would lose the ability to
> say f $ g $ x, but this can be written f . g $ x anyway (dot is
> function composition (a -> b) -> (b -> c) -> a -> c, and does
> right-associate), but many things would require fewer parentheses,
> e.g. f (g x) (h y) can be written f $ g x $ h y.
>
> In fact, the strict function application operator ($!) *is* left-associative.
>
> See http://hackage.haskell.org/trac/haskell-prime/wiki/ChangeDollarAssociativity
> for more information.

Oops. Still learning the basics of Haskell. Interesting, thanks :)

> Also, you say "Pervasives should define it" -- the important thing
> about dollar in Haskell is that it has very low precedence, hence its
> ability to save parentheses. I didn't think OCaml allowed us to
> specify the operator precedence of the infix operators we define.

Yes, the observation was made after seeing that $ would have lower
precedence than function application itself, but this does not say
anything about precedence in relation to other operators..

-- 
Elias Gabriel Amaral da Silva <tolkiendili@gmail.com>


  reply	other threads:[~2010-09-27 11:43 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-23 14:56 ben kuin
2010-09-23 15:21 ` [Caml-list] " David MENTRE
2010-09-23 19:50   ` ben kuin
2010-09-24  0:15     ` Elias Gabriel Amaral da Silva
2010-09-24  7:35       ` David House
2010-09-27 11:43         ` Elias Gabriel Amaral da Silva [this message]
2010-09-24  7:48     ` David MENTRE
2010-09-23 15:25 ` bluestorm
2010-09-23 16:23   ` Jake Donham
2010-09-23 18:49     ` ben kuin
2010-09-23 18:54       ` Jake Donham
2010-09-23 19:06       ` Yoann Padioleau
2010-09-23 16:28 ` Michael Ekstrand
2010-09-23 16:35 ` Sylvain Le Gall
     [not found] ` <1285259219.1820.15.camel@knine>
2010-09-23 18:43   ` [Caml-list] " ben kuin

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=AANLkTik0dfcb1mKa-My9DWz6ggBn-xL21XExX69+Aopt@mail.gmail.com \
    --to=tolkiendili@gmail.com \
    --cc=benkuin@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=dmhouse@gmail.com \
    /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).