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 RAA03244; Mon, 9 Apr 2001 17:57: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 RAA03240 for ; Mon, 9 Apr 2001 17:57: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 f39Fv0P24089; Mon, 9 Apr 2001 17:57:00 +0200 (MET DST) Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id RAA03227; Mon, 9 Apr 2001 17:57:00 +0200 (MET DST) From: Pierre Weis Message-Id: <200104091557.RAA03227@pauillac.inria.fr> Subject: Re: [Caml-list] variant with tuple arg in pattern match? In-Reply-To: from Brian Rogoff at "Apr 8, 101 04:57:27 pm" To: bpr@best.com (Brian Rogoff) Date: Mon, 9 Apr 2001 17:57:00 +0200 (MET DST) Cc: Pierre.Weis@inria.fr, 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 [...] > > I suggest to explicitely annotate the constructor definitions as in: > > > > type t = > > | C : int -> int -> t > > Now that's an interesting idea! > > > 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). > > You meant C : ty -> t of course. Oups. Thank you for the correction. > Getting back to the original problem > and confusing cases, would you still want the shorthands for the cases, > say > > type t = C : int -> int -> t <=> type t = C of int * int ? > type t = C : int * int -> t <=> type t = C of (int * int) > > to be fixed so that the confusions don't arise anymore, or would you just > want to deprecate the earlier notations? > > -- Brian I suggest to support those equivalences while deprecating the earlier notations (after a while, so that the transition would be smooth). This would be easy if Caml users vote for the new notation (I mean if they intensively use the new notation in their programs). I think the new notation is so clean and easy that we would adopt it without discussion as soon as it is available in the language. Cheers, 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