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 SAA20243; Wed, 19 Sep 2001 18:37:29 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id SAA19769 for ; Wed, 19 Sep 2001 18:37:28 +0200 (MET DST) Received: from fledge.watson.org ([204.156.12.50]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f8JGbRX11555 for ; Wed, 19 Sep 2001 18:37:27 +0200 (MET DST) Received: from localhost (patrick@localhost) by fledge.watson.org (8.11.6/8.11.5) with SMTP id f8JGZ9a96291; Wed, 19 Sep 2001 12:35:10 -0400 (EDT) (envelope-from patrick@watson.org) Date: Wed, 19 Sep 2001 12:35:09 -0400 (EDT) From: Patrick M Doane To: Laurent Vibert cc: caml-list@inria.fr Subject: Re: [Caml-list] Polymorphic variant abbreviations In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Wed, 19 Sep 2001, Laurent Vibert wrote: > > I was hoping that I could use this: > > > > let f ~a:#a = ... > > you should write : > > let f ~a : #a = ... But then I get a syntax error for the next argument: let f1 ~a : #a ~b : #b = ... Hmm.. try adding parens as usual for type constraints: let f1 (~a : #a) (~b : #b) = ... but still a syntax error. Move the tilde outside, let f1 ~(a : #a) ~(b : #b) = .. This is syntactically valid, but doesn't give the most flexible typing. Finally, last try: let f1 ~a:(#a as a) ~b:(#b as b) = ... produces the correct type: val f1 : a:#a -> b:#b -> ... It would have been nice if I could achieve that with just a ~ like this: let f1 ~a:#a -> ~b:#b Patrick ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr