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 VAA09790; Sun, 8 Apr 2001 21:46:04 +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 VAA09779 for ; Sun, 8 Apr 2001 21:46:03 +0200 (MET DST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f38JjrD23151; Sun, 8 Apr 2001 21:45:53 +0200 (MET DST) Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id VAA09757; Sun, 8 Apr 2001 21:45:52 +0200 (MET DST) From: Pierre Weis Message-Id: <200104081945.VAA09757@pauillac.inria.fr> Subject: Re: [Caml-list] variant with tuple arg in pattern match? In-Reply-To: <20010407174259.A14454@murlibobo.cs.mu.OZ.AU> from Fergus Henderson at "Apr 7, 101 05:42:59 pm" To: fjh@cs.mu.OZ.AU (Fergus Henderson) Date: Sun, 8 Apr 2001 21:45:52 +0200 (MET DST) Cc: Xavier.Leroy@inria.fr, patrick@watson.org, checker@d6.com, caml-list@inria.fr X-Mailer: ELM [version 2.4ME+ PL28 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > On 06-Apr-2001, Xavier Leroy wrote: > > > > Frankly, I think there is no point in maintaining the illusion that > > datatype constructors are either nullary (constant) or unary. The > > only efficient implementation model is N-ary constructors, so let's > > reflect this in the language. > > Sounds good to me. Now, for consistency, shouldn't you do the same > for function arguments? ;-) > > -- > Fergus Henderson | "I have always known that the pursuit > | of excellence is a lethal habit" > WWW: | -- the last words of T. S. Garp. > ------------------- > To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr I would suggest the other way round: as we already did for functions, we should prefer the curried syntax for constructors. I suggest to explicitely annotate the constructor definitions as in: type t = | C : int -> int -> t This notation is explicit, intuitive, and allows refined type checking in some cases (for instance type 'a t = C : int -> bool -> (int * bool) t). Last but not least, this suggestion is a pure extension of the actual syntax, compatible with the current notations. (We can still allow the form ``C of ty'' as a short hand for C of ty -> t). Hope this helps, Pierre Weis INRIA, Projet Cristal, Pierre.Weis@inria.fr, http://pauillac.inria.fr/~weis/ ------------------- To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr