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=0.1 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id E2D7CBC6C for ; Thu, 31 Jan 2008 21:40:50 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAACvBoUfAXQImh2dsb2JhbACQIgEBAQgKKZ9w X-IronPort-AV: E=Sophos;i="4.25,287,1199660400"; d="scan'208";a="6794394" Received: from discorde.inria.fr ([192.93.2.38]) by mail2-smtp-roc.national.inria.fr with ESMTP; 31 Jan 2008 21:40:50 +0100 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id m0VKeoch017651 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Thu, 31 Jan 2008 21:40:50 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAACvBoUfBMVMPeWdsb2JhbACQIgEBCQQGBiOfcA X-IronPort-AV: E=Sophos;i="4.25,287,1199660400"; d="scan'208";a="7488158" Received: from unknown (HELO ka.univ-orleans.fr) ([193.49.83.15]) by mail1-smtp-roc.national.inria.fr with ESMTP; 31 Jan 2008 21:40:50 +0100 Received: from smtps.univ-orleans.fr (localhost [127.0.0.1]) by ka.univ-orleans.fr (Postfix) with ESMTP id 8ACAF12AD61; Thu, 31 Jan 2008 21:40:47 +0100 (CET) Received: from [192.168.0.1] (lau18-1-82-246-197-195.fbx.proxad.net [82.246.197.195]) by smtps.univ-orleans.fr (Postfix) with ESMTP id D923B36E5B; Thu, 31 Jan 2008 21:40:50 +0100 (CET) Subject: Re: [Caml-list] [OSR] Exceptionless error management From: David Teller To: =?ISO-8859-1?Q?B=FCnzli?= Daniel Cc: caml-list List , Andrej.Bauer@andrej.com In-Reply-To: <1201811141.6565.21.camel@Blefuscu> References: <9d3ec8300801310157r77b86fc0k80f40b1df36091c2@mail.gmail.com> <0640C30E-07B5-4885-AC38-671755BB79AA@erratique.ch> <47A1D68B.70700@fmf.uni-lj.si> <1201811141.6565.21.camel@Blefuscu> Content-Type: text/plain Date: Thu, 31 Jan 2008 21:40:46 +0100 Message-Id: <1201812046.6565.25.camel@Blefuscu> Mime-Version: 1.0 X-Mailer: Evolution 2.12.1 Content-Transfer-Encoding: 7bit X-Miltered: at discorde with ID 47A23252.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; univ-orleans:01 0100,:01 cheers:01 univ-orleans:01 lifo:01 liquidations:98 wrote:01 exception:01 caml-list:01 exceptions:01 lazy:02 occurrences:02 let:03 perhaps:05 thu:05 On Thu, 2008-01-31 at 21:25 +0100, David Teller wrote: > What about a generic > > type result 'r 'e = > | Success of 'r (**The operation was a success*) > | Failure of 'e (**The operation was a failure*) > > let purify e = > try > Success ( Lazy.force e ) > with > exc -> Failure exc > > ? Oh, yeah, "Failure" was perhaps the wrong name to choose, as that's already the name of an exception. So please replace occurrences of "Failure" with "Failed" in the previous message. And to answer a possibly incoming comment about 'e, yeah, it isn't needed for exceptions, although I suspect it can come in handy for operations that are exceptionless in the first place. Cheers, David -- David Teller Security of Distributed Systems http://www.univ-orleans.fr/lifo/Members/David.Teller Angry researcher: French Universities need reforms, but the LRU act brings liquidations.