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,HTML_MESSAGE,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 mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 28CA3BC69 for ; Wed, 24 Oct 2007 15:15:39 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAPbhHkfRVca8mGdsb2JhbACCcotnAQEBAQcCBhMYgSc X-IronPort-AV: E=Sophos;i="4.21,324,1188770400"; d="scan'208";a="18556986" Received: from rv-out-0910.google.com ([209.85.198.188]) by mail4-smtp-sop.national.inria.fr with ESMTP; 24 Oct 2007 15:15:38 +0200 Received: by rv-out-0910.google.com with SMTP id k20so159381rvb for ; Wed, 24 Oct 2007 06:15:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:references:x-google-sender-auth; bh=juI3t81Rxk1y2PH+ltf8sXPAo5njlR2YLJcIp8I5oZY=; b=npG9wg7b9tX57wpHnLBQeQFGXpaw3ISx2fknTtHTxEZuaPalrGuYYDxtDAnwOCcs3tgu/Nl0ZUFwBOnFcef3Vr4CZ0toCHfo8RLL7eUopltqawldVhjv4RdYpZOiHnCi3/pErv9kAQjNlX+/kKhItjRL5MfHgl38fliiI+3LFgI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:references:x-google-sender-auth; b=AnwUX90kPtVSu5UxMUMIXxwf5ZTQcBs/DK735YBmLZLFFB34UhyJqnOlZscOJwchA+OBk71G96t4XQhh/A7lXqJs5U+r/twnMDHxuyrjNsT7aEOY+MqcvloEXabyf+EhYTC0q875LwX7dbPMCiQ2Nj8VnYDLj3ZNzxD6Nuq41Sc= Received: by 10.141.161.6 with SMTP id n6mr243801rvo.1193231736980; Wed, 24 Oct 2007 06:15:36 -0700 (PDT) Received: by 10.141.99.5 with HTTP; Wed, 24 Oct 2007 06:15:36 -0700 (PDT) Message-ID: <891bd3390710240615j7916d8adua64ef1104f3444a8@mail.gmail.com> Date: Wed, 24 Oct 2007 09:15:36 -0400 From: "Yaron Minsky" Sender: yminsky@gmail.com To: "Joel Reymont" Subject: Re: [Caml-list] Preferred use of Invalid_argument and Failure Cc: "O'Caml Mailing List" In-Reply-To: <0D7AC9CC-1885-4C13-8D9F-31C2D6BEFEE2@gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_3745_32786627.1193231736967" References: <867ildqacq.fsf@Llea.celt.neu> <471EFD20.5010303@inria.fr> <891bd3390710240405l40ddee68l1d8876c7be98ff34@mail.gmail.com> <0D7AC9CC-1885-4C13-8D9F-31C2D6BEFEE2@gmail.com> X-Google-Sender-Auth: 9bc641e1a2a883e3 X-Spam: no; 0.00; yaron:01 minsky:01 yminsky:01 alist:01 yaron:01 minsky:01 variants:01 variants:01 beginner's:01 ocaml:01 bug:01 alist:01 beginner's:01 ocaml:01 bug:01 ------=_Part_3745_32786627.1193231736967 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline As in: map_of_alist : ('a * 'b) list -> [ `Repeated_key of 'a | `Succ of ('a,'b) Map.t ] The return value is both explicit and a polymorphic variant. y On 10/24/07, Joel Reymont wrote: > > Yaron, > > On Oct 24, 2007, at 12:05 PM, Yaron Minsky wrote: > > > Where I work, we have come to dearly love the practice of returning > > polymorphic variants with explicit variants for various "normal" > > error cases. > > Can you elaborate? Are your explicit variants still polymorphic? > > -- > http://wagerlabs.com > > > > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > ------=_Part_3745_32786627.1193231736967 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline As in:

  map_of_alist : ('a * 'b) list -> [ `Repeated_key of 'a | `Succ of ('a,'b) Map.t ]

The return value is both explicit and a polymorphic variant.

y

On 10/24/07, Joel Reymont <joelr1@gmail.com> wrote:
Yaron,

On Oct 24, 2007, at 12:05 PM, Yaron Minsky wrote:

> Where I work, we have come to dearly love the practice of returning
> polymorphic variants with explicit  variants for various "normal"
> error cases.

Can you elaborate? Are your explicit variants still polymorphic?

--
http://wagerlabs.com




_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

------=_Part_3745_32786627.1193231736967--