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.4 required=5.0 tests=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 mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id B61A4BC6B for ; Tue, 12 Feb 2008 01:29:44 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAKJ2sEfRVca4kmdsb2JhbACQPAEBAQEHBAQJChaVJIRp X-IronPort-AV: E=Sophos;i="4.25,335,1199660400"; d="scan'208";a="7942252" Received: from discorde.inria.fr ([192.93.2.38]) by mail1-smtp-roc.national.inria.fr with ESMTP; 12 Feb 2008 01:29:44 +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 m1C0TiqR008365 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Tue, 12 Feb 2008 01:29:44 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAKJ2sEfRVca4kmdsb2JhbACQPAEBAQEHBAQJChaVJIRp X-IronPort-AV: E=Sophos;i="4.25,335,1199660400"; d="scan'208";a="7942246" Received: from rv-out-0910.google.com ([209.85.198.184]) by mail1-smtp-roc.national.inria.fr with ESMTP; 12 Feb 2008 01:29:42 +0100 Received: by rv-out-0910.google.com with SMTP id g11so3206930rvb.57 for ; Mon, 11 Feb 2008 16:29:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:references:message-id:from:to:in-reply-to:content-type:mime-version:subject:content-transfer-encoding:date:cc:x-mailer; bh=E+y7/bQ4OnDAYmzae5evuO8i3e9oc5TX0H6KKQYztGw=; b=bRoLL+pPOYVEJYzwJmhzcuWoeWbS5yVS36MxijWAm0kfazEOAcXgCg6dKWUHkL8pZGevbG1fKZxaqpe+8iiNPJRlA8F5nirIhytJuPlhv66xIJIAQYHGb38mlPKOFrZbGcZ+DwL6kpB5xaEchMU0LOXUNiDkheR3AtwHO41thQA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=references:message-id:from:to:in-reply-to:content-type:mime-version:subject:content-transfer-encoding:date:cc:x-mailer; b=cREdbn2lYmtVbe7lr2dZtNsiyRGcJtTB5X2IBDxhc/lQPa9gd730S8wJztu239Y5sYFLYzsFfqWNofp5q3RhhnZPscsBNa3S5vN5NpbgtzqcoDRBG/7jWFi0oHch8A+MGNRKNtlDcfbX7S1Of+EK4VRrqosgi7a0Hc3C+f0YfIQ= Received: by 10.141.50.17 with SMTP id c17mr435456rvk.295.1202776181802; Mon, 11 Feb 2008 16:29:41 -0800 (PST) Received: from ?192.168.0.186? ( [24.239.179.95]) by mx.google.com with ESMTPS id l21sm1951325rvb.26.2008.02.11.16.29.40 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 11 Feb 2008 16:29:41 -0800 (PST) References: <1202396482.6084.5.camel@Blefuscu> <891bd3390802101047o187a94fch8f66a6c8a457d391@mail.gmail.com> <1202681123.6278.40.camel@Blefuscu> <891bd3390802101816r6812a574nc074abd67faf2039@mail.gmail.com> <1202719508.6348.42.camel@Blefuscu> <891bd3390802110412p4de4cba0me596640e55c6b994@mail.gmail.com> <1202734409.6348.60.camel@Blefuscu> Message-Id: <886690B3-6EC1-44E5-8ABD-23A72489831C@gmail.com> From: Yaron Minsky To: David Teller In-Reply-To: <1202734409.6348.60.camel@Blefuscu> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Mime-Version: 1.0 (iPhone Mail 4A93) Subject: Re: [Caml-list] [OSR] Exceptionless error management, take 2 Content-Transfer-Encoding: 7bit Date: Mon, 11 Feb 2008 18:09:15 -0500 Cc: OCaml X-Mailer: iPhone Mail (4A93) X-Miltered: at discorde with ID 47B0E878.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; yaron:01 minsky:01 yminsky:01 monadic:01 monadic:01 daniel's:01 monads:01 cheers:01 yaron:01 minsky:01 confuses:01 verbose:01 variants:01 monads:01 univ-orleans:01 On Feb 11, 2008, at 7:53 AM, David Teller wrote: > I'm not sure where you see approach 2. I'm probably the one being confusing here. My only point is: the monadic interface seems unlikely to work well, and so it seems to me like a bad idea to make compromises to the simplicity and terseness of the approach for the potential of making an efficient monadic implementation later. In short, I would use the status type directly and eliminate the may_fail Y > My suggestion deals with approach 1, while Daniel's is approach 3. The > point of monads is not related to converting exceptions, but rather to > being able to compose functions without having to add a manual check > at > each step. And the point of this "optimized" monad implementation is > just to make that faster. > > If the confusion is caused by my answer to your previous post, I just > realized that my fixing your "bind" was a mistake. Please accept my > apologies, I misread what you had written. > > Now, if this candidate is too confusing -- which I can't judge, as I > wrote it -- perhaps something less confusing would be more > appropriate. > > Cheers, > David > > On Mon, 2008-02-11 at 07:12 -0500, Yaron Minsky wrote: >> Something about this whole error-handling proposal confuses me. >> Here's my concern: I can see 3 approaches, all having to do with what >> goes in the 'b slot in the ('a,'b) status type: >> 1. Use different, wholly incompatible types in 'b. This allows >> you to put useful information into the signature of each >> error-producing function, but basically requires individual >> handling of each error. No monadic magic and no conversion to >> exceptions is possible, and each error must be handled >> individually. It's more explicit and more verbose. >> 2. Use the same type in 'b everywhere. There's no extra >> explicitness here, and I don't actually see any advantage over >> just using exceptions. >> 3. Use different but compatible types, e.g., polymorphic >> variants. Then you get both explicitness and the chance to >> use monadic or other tricks to join together the errors at the >> type level. That has some clear advantages (the type system >> can infer for you the ser of all possible error messages), but >> we've found it leads to some sticky type error messages in >> some cases. >> So, I understand why someone would try (1) or (3), but (2) seems >> utterly pointless to me. The proposal seems to be aiming at (1), but >> then there's all this talk of monads which doesn't seem to fit (1). >> >> Am I missing something? >> >> y > -- > 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. >