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 KAA06113; Wed, 19 Sep 2001 10:37:24 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id KAA05395 for ; Wed, 19 Sep 2001 10:37:23 +0200 (MET DST) Received: from feu.irisa.fr (feu.irisa.fr [131.254.60.80]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id f8J8bM118767 for ; Wed, 19 Sep 2001 10:37:22 +0200 (MET DST) Received: from mushroom.irisa.fr (mushroom.irisa.fr [131.254.12.13]) by feu.irisa.fr (8.11.4/8.11.4) with ESMTP id f8J8bKb07796; Wed, 19 Sep 2001 10:37:21 +0200 (MET DST) Date: Wed, 19 Sep 2001 10:37:20 +0200 (MET DST) From: Laurent Vibert To: Patrick M Doane cc: caml-list@inria.fr Subject: Re: [Caml-list] Polymorphic variant abbreviations 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 Tue, 18 Sep 2001, Patrick M Doane wrote: > (* The first works as I would expect, the second gives a very unexpected > type. There seems to be some kind of unexpected unification going on > between terms. *) > > let h1 (#b as x1) (#c as x2) = `A [x1; x2] here #b is a pattern, it is the same as let h1 (`B as x1) (`C as x2) = `A [x1; x2] > let h2 (x1 : #b) (x2 : #c) = `A [x1; x2] but here it is a type expression, and is the same as let h2 (x1 : [< `B]) (x2 : [< `C]) = `A [x1; x2] and in a list, all argument must have the same type, tou take the intersection of both and obtain [ ] ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr