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 KAA04431; Wed, 19 Sep 2001 10:01:16 +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 KAA05210 for ; Wed, 19 Sep 2001 10:01:15 +0200 (MET DST) Received: from feu.irisa.fr (feu.irisa.fr [131.254.60.80]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f8J81EX10530 for ; Wed, 19 Sep 2001 10:01:15 +0200 (MET DST) Received: from mushroom.irisa.fr (mushroom.irisa.fr [131.254.12.13]) by feu.irisa.fr (8.11.4/8.11.4) with ESMTP id f8J81Cb05297; Wed, 19 Sep 2001 10:01:12 +0200 (MET DST) Date: Wed, 19 Sep 2001 10:01:12 +0200 (MET DST) From: Laurent Vibert To: Patrick M Doane 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 Tue, 18 Sep 2001, Patrick M Doane wrote: > I have some code that would like to use polymorphic type abbreviations > along with labels. It seems to be not behaving quite like I expected. > What could I do to make this shorter: > > type a = [ `A ] > > let f ~a:(#a as a) = ... > > I was hoping that I could use this: > > let f ~a:#a = ... you should write : let f ~a : #a = ... the problem is that #a is both a type expression and a pattern, and in your expression, it's a pattern. For example if you write : let f ~a:int = int the int is not a type expression ! ------------------- 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