From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 36B0C7EE5B for ; Tue, 27 May 2014 12:05:43 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of goswin-v-b@web.de) identity=pra; client-ip=212.227.15.4; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="goswin-v-b@web.de"; x-sender="goswin-v-b@web.de"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of goswin-v-b@web.de) identity=mailfrom; client-ip=212.227.15.4; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="goswin-v-b@web.de"; x-sender="goswin-v-b@web.de"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mout.web.de) identity=helo; client-ip=212.227.15.4; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="goswin-v-b@web.de"; x-sender="postmaster@mout.web.de"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AlgBAKVihFPU4w8EnGdsb2JhbABZsXWUUAGBDRYOAQEBAQEGDQkJFCiCJQEBBScTTwsYCSUPBSiIYQEYzU4fhlIXjlkWgxWBFQEDmXKGVRKPew X-IPAS-Result: AlgBAKVihFPU4w8EnGdsb2JhbABZsXWUUAGBDRYOAQEBAQEGDQkJFCiCJQEBBScTTwsYCSUPBSiIYQEYzU4fhlIXjlkWgxWBFQEDmXKGVRKPew X-IronPort-AV: E=Sophos;i="4.98,918,1392159600"; d="scan'208";a="64315924" Received: from mout.web.de ([212.227.15.4]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 27 May 2014 12:05:42 +0200 Received: from frosties.localnet ([78.43.112.61]) by smtp.web.de (mrweb001) with ESMTPSA (Nemesis) id 0LgpYk-1WSnrf31S2-00oDCi for ; Tue, 27 May 2014 12:05:41 +0200 Received: from mrvn by frosties.localnet with local (Exim 4.82) (envelope-from ) id 1WpEGK-0004Ww-8S for caml-list@inria.fr; Tue, 27 May 2014 12:05:40 +0200 Date: Tue, 27 May 2014 12:05:40 +0200 From: Goswin von Brederlow To: caml-list@inria.fr Message-ID: <20140527100540.GC15848@frosties> References: <53835610.9050609@inria.fr> <53B801AD6F5B4BFBA0DA2A69D8775497@erratique.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Provags-ID: V03:K0:4iWiSPfHxoTIcpYyeN3OHMucGyQWRoPhEnexj5yZyAMBtjkz0ik r2dwCN8z/fsPba189/+LtUz+MoTh1UpFigdMVGHJEgVf6ymhiK7KfVFjDP8RJxiEVOsjWUt 64bkZs8lgQ88dkbafIBZmIzIXwyN4CNem07Ul4V4100SmeBa0uWXx1IKv/AoryyRo6S149O tO25+NMdJjCEI141VcQBQ== Subject: Re: [Caml-list] Uncaught exceptions in function type. On Tue, May 27, 2014 at 09:42:35AM +0100, Ben Millwood wrote: > One particularly galling aspect of exceptions not showing up in types is > that they can't easily be refactored. If you decide to change which > exceptions a given function throws, you can't rely on the typechecker to > flag up where code was written to the old specification and needs changing. > You can't even just eyeball the code to see where the function was used and > see if the exception was caught, because who knows where in the call stack > it might have been handled? Explicit error types, on the other hand, will > refuse to compile unless you have changed your code to deal with it, so you > can make your errors richer or more precise with a high level of confidence > that you haven't introduced any "holes" for exceptional conditions to sneak > out where previously they couldn't. > > This is essentially why we still have a few Not_found exceptions in Core, > because it's really pretty hard to know where they might be relied upon, so > it's easier to leave them in than purge them and risk silent breakage. HUH? Say you have a function val f : ('a, 'b) t -> 'a -> 'b (raise [Not_found]) then eliminating Not_found that function would become val f : ('a, 'b) t -> 'a -> 'b option That should fail to compile if the return type is used or a signature exists. Where do you think a change would go unnoticed? MfG Goswin