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 CAA14726; Mon, 9 Apr 2001 02:22:57 +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 CAA14719 for ; Mon, 9 Apr 2001 02:22:56 +0200 (MET DST) Received: from nef.ens.fr (nef.ens.fr [129.199.96.32]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f390MsD26461; Mon, 9 Apr 2001 02:22:54 +0200 (MET DST) Received: from clipper.ens.fr (clipper-gw.ens.fr [129.199.1.22]) by nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id f390Msq32647 ; Mon, 9 Apr 2001 02:22:54 +0200 (CEST) Received: from localhost (frisch@localhost) by clipper.ens.fr (8.9.2/jb-1.1) id CAA07532 ; Mon, 9 Apr 2001 02:22:54 +0200 (MET DST) Date: Mon, 9 Apr 2001 02:22:54 +0200 (MET DST) From: Alain Frisch To: Pierre Weis , Caml list Subject: Re: [Caml-list] variant with tuple arg in pattern match? 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 Sun, 8 Apr 2001, Pierre Weis wrote: > 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). How does this interact with pattern matching ? If constructor types are not uniform, it seems that it is no longer possible to say whether a simple (without guards) pattern matching is exhaustive or not. For instance, with the declaration: type 'a t = A : int t | B : 'a -> 'a t do you issue a warning for: function B x -> x ? -- Alain Frisch ------------------- To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr