From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id EAA24057; Thu, 26 Apr 2001 04:11:33 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id EAA23905 for ; Thu, 26 Apr 2001 04:11:32 +0200 (MET DST) Received: from shell5.ba.best.com (shell5.ba.best.com [206.184.139.136]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id f3Q2BVP25377 for ; Thu, 26 Apr 2001 04:11:31 +0200 (MET DST) Received: from localhost (bpr@localhost) by shell5.ba.best.com (8.9.3/8.9.2/best.sh) with ESMTP id TAA26410; Wed, 25 Apr 2001 19:11:30 -0700 (PDT) Date: Wed, 25 Apr 2001 19:11:29 -0700 (PDT) From: Brian Rogoff To: Charles Martin cc: caml-list@inria.fr Subject: Re: [Caml-list] operators: compose and Haskell's $ operator In-Reply-To: <5.0.2.1.0.20010425181746.0221cb20@chasm.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Wed, 25 Apr 2001, Charles Martin wrote: > At 05:57 PM 4/25/01 -0700, you wrote: > >On Wed, 25 Apr 2001, Charles Martin wrote: > >>equivalent for the $ operator eludes me, as it needs to be right > >>associative and of low precedence. > > > ># let ( <-> ) f x = f x;; > >val ( <-> ) : ('a -> 'b) -> 'a -> 'b = > > Unfortunately, this is left-associative: Oops, you're right of course. Given that there seems to be no solution, I guess a little extra parenthesization is your only "pure OCaml option" option. I've only seen the $ used heavily in code that uses the do notation, where OCaml might use (gasp!) imperative code with ;, so I've never been tempted to write a syntax extension for this. -- Brian ------------------- To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr