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 UAA03594; Tue, 1 Apr 2003 20:28:49 +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 UAA05643 for ; Tue, 1 Apr 2003 20:28:47 +0200 (MET DST) Received: from athlon.baretta.com ([213.255.109.130]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h31ISl917851 for ; Tue, 1 Apr 2003 20:28:47 +0200 (MET DST) Received: from baretta.com (localhost.localdomain [127.0.0.1]) by athlon.baretta.com (Postfix) with ESMTP id A2C2227439 for ; Tue, 1 Apr 2003 19:34:24 +0200 (CEST) Message-ID: <3E89CDA0.7090200@baretta.com> Date: Tue, 01 Apr 2003 19:34:24 +0200 From: Alessandro Baretta Organization: Baretta srl -- www.baretta.com User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020826 X-Accept-Language: it, en MIME-Version: 1.0 To: Ocaml Subject: [Caml-list] Typing problem with polymorphic variants Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; alessandro:01 baretta:01 val:01 foo:01 incompatible:01 checker:01 variants:01 alex:01 int:01 width:98 polymorphic:01 signatures:02 match:02 string:03 typing:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk This just baffles me. > Values do not match: > val feature : > [> `Clear | `Length of int | `Pitch of int > | `Width of 'a] -> string > is not included in > val feature : [> `Clear] -> string Why are "match-anything" functions of the kind of let f = function | `Foo -> "foo" | `Bar -> "bar" | _ -> "?" incompatible with signatures like val f : [> `Foo ] -> string ? There clearly is no case when a value of type [> `Foo] will not be acceptable for f. So why does the type checker reject this? Alex ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners