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 mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 97566BBAF for ; Mon, 27 Sep 2010 13:43:28 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AoIBAF4goExKfVI0kGdsb2JhbACiKAgVAQEBAQkJDAcRAx+qG4k9gheGFy6IVQEBAwWFPwSKOoVg X-IronPort-AV: E=Sophos;i="4.57,243,1283724000"; d="scan'208";a="73584455" Received: from mail-ww0-f52.google.com ([74.125.82.52]) by mail1-smtp-roc.national.inria.fr with ESMTP; 27 Sep 2010 13:43:28 +0200 Received: by wwi17 with SMTP id 17so3779708wwi.9 for ; Mon, 27 Sep 2010 04:43:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=7+gNLJm8eadfP+f2+S6Qw36THOzs/+F8yg6lqhuuLoA=; b=rAQl3EoVdW90r2ALfmXa2M/wY3MNBeyFAq+YfGxsk4t54mPmi8LEWJ2mV6MWo8hBu2 A1A+CXcN0xy5v9T/xUPSEZ114GfsPbhGOo6IHySJ5sTLVhXsXXioy8DZjkIxNljZw+C2 q97ju2OTCcf2D+7S2uWehwM5ylDgyh9Ovk1Yk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=dLZyc3aru9fx+8xTO80MqxgXnOqE6dZlAmNz9emWoJR2D1tJwycM5L5YoFou5uXU25 zIxIA+qeHmDv7qBzOqcE+LSH8B4XO0nnwEF61yxgOuln35jJQ0RoRLKd3ih0p5z2I17Z 6dIENnGmQJEMQ4cjI+rj31u2i1Xx204ZGGaTM= MIME-Version: 1.0 Received: by 10.216.232.90 with SMTP id m68mr6091145weq.10.1285587808210; Mon, 27 Sep 2010 04:43:28 -0700 (PDT) Received: by 10.216.131.37 with HTTP; Mon, 27 Sep 2010 04:43:28 -0700 (PDT) In-Reply-To: References: Date: Mon, 27 Sep 2010 08:43:28 -0300 Message-ID: Subject: Re: [Caml-list] what do I need to know to understand camlp4 From: Elias Gabriel Amaral da Silva To: David House Cc: ben kuin , caml-list@inria.fr Content-Type: text/plain; charset=ISO-8859-1 X-Spam: no; 0.00; camlp:01 haskell:01 haskell:01 wiki:01 pervasives:01 ocaml:01 infix:01 silva:98 silva:98 precedence:01 precedence:01 caml-list:01 parentheses:01 parentheses:01 oops:01 2010/9/24 David House : > 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