From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 027A9BBAF for ; Mon, 31 May 2010 17:00:36 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AugBAEdsA0yBWB4FmWdsb2JhbACeSAEBAQEBCAsKBxEiwQOFFgQ X-IronPort-AV: E=Sophos;i="4.53,334,1272837600"; d="scan'208";a="63702886" Received: from mx1.imag.fr (HELO shiva.imag.fr) ([129.88.30.5]) by mail4-smtp-sop.national.inria.fr with ESMTP; 31 May 2010 17:00:36 +0200 Received: from rhin.imag.fr (rhin.imag.fr [147.171.129.2]) by shiva.imag.fr (8.13.8/8.13.8) with ESMTP id o4VErIvU021721 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 31 May 2010 16:53:18 +0200 Received: from [147.171.129.114] (prahova.imag.fr [147.171.129.114]) by rhin.imag.fr (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id o4VF0VRo014775; Mon, 31 May 2010 17:00:33 +0200 Message-ID: <4C03CF0F.9080707@imag.fr> Date: Mon, 31 May 2010 17:00:31 +0200 From: Florent Ouchet Reply-To: florent.ouchet@imag.fr Organization: Tima/CIS User-Agent: Mozilla-Thunderbird 2.0.0.19 (X11/20090103) MIME-Version: 1.0 To: Goswin von Brederlow Cc: caml-list@inria.fr Subject: Re: [Caml-list] Static exception analysis or alternative to using exceptions References: <20100527170122.GA28273@annexia.org> <87y6f0cf4p.fsf@frosties.localdomain> In-Reply-To: <87y6f0cf4p.fsf@frosties.localdomain> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.0.1 (shiva.imag.fr [129.88.30.5]); Mon, 31 May 2010 16:53:18 +0200 (CEST) X-IMAG-MailScanner-Information: Please contact MI2S MIM for more information X-MailScanner-ID: o4VErIvU021721 X-IMAG-MailScanner: Found to be clean X-IMAG-MailScanner-SpamCheck: X-IMAG-MailScanner-From: florent.ouchet@imag.fr MailScanner-NULL-Check: 1275922400.93456@mrAhhlwugAbJZSUywqai/A X-Spam: no; 0.00; val:01 val:01 ocamlexc:01 tima:01 discontinued:98 imho:01 compilers:01 exception:01 exception:01 caml-list:01 exceptions:01 exceptions:01 imag:02 module:03 unit:03 Goswin von Brederlow a écrit : > Imho a good module should provide both an exception and option based > interface to fit the circumstances and programming style. > > +1 > It would be nice if the possible exceptions of a function would be part > of the type. E.g. > > let f1 () = raise Not_found > val f1 : unit -> 'a [ Not_found ] > > let f2 () = try f1 () with Not_found -> () > val f2 : unit -> unit > > let f3 f = try f () with Not_found -> () > val f3: (unit -> 'a [< Not_found | 'B ]) -> 'a [ 'B ] > > and so on. > > > Someone would have to write a new type system for that though. > > ocamlexc gave such results, but this tool is now discontinued and not compatible with latest compilers :( -- Florent Ouchet PhD Student CIS/VDS Team - TIMA Laboratory