From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=AWL,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 31661BC6C for ; Thu, 7 Feb 2008 17:06:28 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAANK6qkdA6ba9i2dsb2JhbACQMQEBAQgEBAkKEQWBF5UWhTQ X-IronPort-AV: E=Sophos;i="4.25,316,1199660400"; d="scan'208";a="8923313" Received: from concorde.inria.fr ([192.93.2.39]) by mail3-smtp-sop.national.inria.fr with ESMTP; 07 Feb 2008 17:06:28 +0100 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id m17G6K1Y015500 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Thu, 7 Feb 2008 17:06:27 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAANK6qkdA6ba9i2dsb2JhbACQMQEBAQgEBAkKEQWBF5UWhTQ X-IronPort-AV: E=Sophos;i="4.25,316,1199660400"; d="scan'208";a="8923312" Received: from nf-out-0910.google.com ([64.233.182.189]) by mail3-smtp-sop.national.inria.fr with ESMTP; 07 Feb 2008 17:06:27 +0100 Received: by nf-out-0910.google.com with SMTP id g13so1053528nfb.7 for ; Thu, 07 Feb 2008 08:06:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; bh=nQV/n1YMNkVy48tqLD/ZlyeA/q9uB28SKSIRlnkheZU=; b=NXN+3YHzP0Bi90i4Oe3wt5QwPLzmCe7WPwdTwADcTZE2genJ/FDJx6KhCklzrMoCqSdluvDIh25fziAMFTirApKDGq/M6t0oxsydKtipcI+/VGe+yR39djHp9+FT+rlgS3XCE8YCgLrA2Yyhv7OOBGQ/Dvc/tik0s/BiR6ifPLM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=DfkPOh2OrFm5SAKdzfcsVNr2f3tRweYjqbK5C4uyqdCA9mdYte+so/qlDkFiBpqPpvWFaoAKQrrhEr+SaGi/igQUbS6AclinSo1QWW3jqeoAoFUCoaG6V6hkaqMehBfCyRpvqSIRSylpNkySTVSF+n0ungz6al6fWtdamrqYvBc= Received: by 10.78.155.4 with SMTP id c4mr20474816hue.79.1202400386461; Thu, 07 Feb 2008 08:06:26 -0800 (PST) Received: by 10.78.25.10 with HTTP; Thu, 7 Feb 2008 08:06:26 -0800 (PST) Message-ID: <95513600802070806p38d1cf6fxa5726477facb901b@mail.gmail.com> Date: Thu, 7 Feb 2008 17:06:26 +0100 From: "Olivier Andrieu" Sender: oandrieu@gmail.com To: "David Teller" Subject: Re: [Caml-list] [OSR] Exceptionless error management, take 2 Cc: caml-list@inria.fr In-Reply-To: <1202399557.6084.24.camel@Blefuscu> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <1202396482.6084.5.camel@Blefuscu> <20080208.001729.233402575.garrigue@math.nagoya-u.ac.jp> <1202399557.6084.24.camel@Blefuscu> X-Google-Sender-Auth: 19a7a7b482c3a96c X-Miltered: at concorde with ID 47AB2C7C.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; andrieu:01 oandrieu:01 univ-orleans:01 val:01 syntax:01 syntax:01 wrote:01 caml-list:01 nerim:01 int:01 int:01 variant:02 variant:02 match:02 match:02 On Feb 7, 2008 4:52 PM, David Teller wrote: > For instance, let's consider the following extract: > > val parse_int : string -> (int, [`Syntax | `Overflow]) may_fail > > match result (parse_int "523.5") with > | Success i -> (*...*) > | Error `IncorrectSyntax -> (*...*) > | _ as e -> throw e > > This code is perfectly legitimate. Err no, it's not, you'll get a type error since the variant is closed in the signature of parse_int: This pattern matches values of type (int, [> `IncorrectSyntax ]) may_fail but is here used to match values of type (int, [ `Overflow | `Syntax ]) may_fail The second variant type does not allow tag(s) `IncorrectSyntax -- Olivier