From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id XAA16496 for caml-red; Sun, 8 Oct 2000 23:10:39 +0200 (MET DST) 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 WAA15455 for ; Sun, 8 Oct 2000 22:07:34 +0200 (MET DST) Received: from isil.localdomain (adsl-151-201-232-68.bellatlantic.net [151.201.232.68]) by concorde.inria.fr (8.10.0/8.10.0) with ESMTP id e98K7XX21523 for ; Sun, 8 Oct 2000 22:07:33 +0200 (MET DST) Received: by isil.localdomain (Postfix, from userid 1000) id F2FFE37655; Sun, 8 Oct 2000 16:09:22 -0400 (EDT) To: Julian Assange Cc: caml-list@inria.fr Subject: Re: polymorphic variant oddity References: From: John Prevost Date: 08 Oct 2000 16:09:22 -0400 In-Reply-To: Message-ID: <87lmvzjdsd.fsf@localhost.localdomain.> User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: weis@pauillac.inria.fr >>>>> "ja" == Julian Assange writes: ja> Unbound value x ja> # let `F x = 1;; ja> This expression has type int but is here used with type [< `F of 'a | ..] ja> # let `F x = `F 1;; ja> val x : int = 1 ja> # `F 4;; ja> - : [> `F of int] = `F 4 ja> What exactly is the meaning this? Looks like normal pattern matching to me: # let Some x = x;; Unbound value x # let Some x = 1;; This expression has type int but is here used with type 'a option # let Some x = Some 1;; Warning: this pattern-matching is not exhaustive. Here is an example of a value that is not matched: None val x : int = 1 # Some 4;; - : int option = Some 4 What did you expect to happen? John.