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.0 required=5.0 tests=none 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 44664BC6C for ; Thu, 31 Jan 2008 21:00:02 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ao8CAI63oUfY87Fk/2dsb2JhbACwXg X-IronPort-AV: E=Sophos;i="4.25,286,1199660400"; d="scan'208";a="8587121" Received: from concorde.inria.fr ([192.93.2.39]) by mail3-smtp-sop.national.inria.fr with ESMTP; 31 Jan 2008 21:00:01 +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 m0VK01Z9030863 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Thu, 31 Jan 2008 21:00:01 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ao8CAI63oUfY87Fk/2dsb2JhbACwXg X-IronPort-AV: E=Sophos;i="4.25,286,1199660400"; d="scan'208";a="8587118" Received: from elehack.net ([216.243.177.100]) by mail3-smtp-sop.national.inria.fr with ESMTP; 31 Jan 2008 21:00:00 +0100 Received: by ahijah.elehack.net (Postfix, from userid 1001) id A649E2E049; Thu, 31 Jan 2008 14:00:52 -0600 (CST) To: David Teller Cc: caml-list@inria.fr Subject: Re: [Caml-list] [OSR] Exceptionless error management References: <9d3ec8300801310157r77b86fc0k80f40b1df36091c2@mail.gmail.com> <0640C30E-07B5-4885-AC38-671755BB79AA@erratique.ch> <47A1D68B.70700@fmf.uni-lj.si> <87myqmcc7v.fsf@jehiel.elehack.net> <1201807692.6565.14.camel@Blefuscu> From: Michael Ekstrand Date: Thu, 31 Jan 2008 13:59:55 -0600 In-Reply-To: <1201807692.6565.14.camel@Blefuscu> (David Teller's message of "Thu\, 31 Jan 2008 20\:28\:12 +0100") Message-ID: <8763x9epfo.fsf@jehiel.elehack.net> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Miltered: at concorde with ID 47A228C1.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 univ-orleans:01 functorize:01 overkill:01 sig:01 gpg:01 exception:01 caml-list:01 writes:01 variant:02 modules:02 modules:02 module:03 module:03 confused:04 David Teller writes: > What else ? We could presumably functorize modules upon the definition > of a error-delivery mechanism, but that might be overkill. > > Say > module type ErrorMechanism = sig > type 't; (**The type of a failure.*) > type 'a can_fail; > (**The type of a value that can either succeed > and produce a result of type 'a or fail and > produce an error of type t. *) > value fail : t -> 'a can_fail ; > (**Fail. Depending on the mechanism, this may > either return some variant on option or > throw an exception.*) > > value succeed : 'a -> 'a can_fail ; > (**Succeed.*) > end;; This could have some interesting ramifications, such as aiding in the construction of a condition/restart mechanism. However, standard instantiations of these functorized modules should probably be provided to make the common case (using the module with one or the other standard behavior) easy. - Michael -- mouse, n: A device for pointing at the xterm in which you want to type. Confused by the strange files? I cryptographically sign my messages. For more information see .