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 LAA19204; Tue, 10 Apr 2001 11:07:12 +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 LAA19195 for ; Tue, 10 Apr 2001 11:07:11 +0200 (MET DST) Received: from dpt-info.u-strasbg.fr (dpt-info.u-strasbg.fr [130.79.6.1]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f3A979b17657; Tue, 10 Apr 2001 11:07:09 +0200 (MET DST) Received: from lambda.u-strasbg.fr (lambda.u-strasbg.fr [130.79.90.63]) by dpt-info.u-strasbg.fr (8.9.3/8.9.3) with ESMTP id LAA20362; Tue, 10 Apr 2001 11:06:19 +0200 Received: from luther by lambda.u-strasbg.fr with local (Exim 3.22 #1 (Debian)) id 14mu7y-0003pC-00; Tue, 10 Apr 2001 11:07:58 +0200 Date: Tue, 10 Apr 2001 11:07:58 +0200 To: Pierre Weis Cc: Brian Rogoff , caml-list@inria.fr Subject: Re: [Caml-list] variant with tuple arg in pattern match? Message-ID: <20010410110758.A14694@lambda.u-strasbg.fr> References: <200104091557.RAA03227@pauillac.inria.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.17i In-Reply-To: <200104091557.RAA03227@pauillac.inria.fr>; from Pierre.Weis@inria.fr on Mon, Apr 09, 2001 at 05:57:00PM +0200 From: Sven LUTHER Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Mon, Apr 09, 2001 at 05:57:00PM +0200, Pierre Weis wrote: > [...] > > > 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. And it would permit us to do : type t = A of int -> int err that is type t = A : int -> int instead of having to add parentheses around it ? # type t = A of int -> int ;; Syntax error # type t = A of (int -> int) ;; type t = A of (int -> int) Friendly, Sven Luther ------------------- To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr