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 OAA25100; Tue, 10 Apr 2001 14:34:15 +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 OAA25096 for ; Tue, 10 Apr 2001 14:34:14 +0200 (MET DST) Received: from quincy.inria.fr (quincy.inria.fr [128.93.8.52]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f3ACYCb24650; Tue, 10 Apr 2001 14:34:12 +0200 (MET DST) Received: (from mauny@localhost) by quincy.inria.fr (8.10.1/8.10.1) id f3ACZkq14241; Tue, 10 Apr 2001 14:35:46 +0200 Date: Tue, 10 Apr 2001 14:35:46 +0200 From: Michel Mauny To: reig@dcs.gla.ac.uk Cc: caml-list@inria.fr Subject: Re: [Caml-list] variant with tuple arg in pattern match? Message-ID: <20010410143546.A14134@quincy.inria.fr> Reply-To: Michel.Mauny@inria.fr References: <200104101147.MAA11108@crab.dcs.gla.ac.uk> <200104101210.NAA11307@crab.dcs.gla.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.2.5i In-Reply-To: <200104101210.NAA11307@crab.dcs.gla.ac.uk>; from reig@dcs.gla.ac.uk on Tue, Apr 10, 2001 at 01:10:44PM +0100 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk reig@dcs.gla.ac.uk wrote/écrivait (Apr 10 2001, 01:10PM +0100): > In fact, the syntax for the type definition could be like in haskell: > use juxtaposition. > > type 'a t = Curried : ('a t) ('a t) > | Function : 'a t -> 'a t > In this case, there is an ambiguity between curryfication and type constructors application. In type t = C : int bool is C of type int -> bool -> t, or is bool a unary type constructor, with int as argument. Compare with type t = C : int list for instance. Parsing would need typing information, here. Haskell avoids this in using the same notation (juxtaposition) all the way long. That is, the examples above would be written as type t = C int bool type t = C (int list) and made unambiguous using parens. Using a `:' right after the data constructor is (to me) less clear than the Haskell notation. Maybe because of type constraints and module interfaces. -- Michel ------------------- To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr