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 814407EE5B for ; Mon, 26 May 2014 17:34:15 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of gabriel.scherer@gmail.com) identity=pra; client-ip=209.85.220.175; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of gabriel.scherer@gmail.com designates 209.85.220.175 as permitted sender) identity=mailfrom; client-ip=209.85.220.175; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-vc0-f175.google.com) identity=helo; client-ip=209.85.220.175; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="postmaster@mail-vc0-f175.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AugBAItdg1PRVdyvlGdsb2JhbABZhDGCaqpZlE4BgQsIFg4BAQEBBwsLCRIqgiUBAQEEEhEdARsdAQMMBgULDQICJgICIQEBEQEFARwGEwgaiAsBAxGjTWqLJ4Fygw2ZbwoZJw1khTYRAQUMgR6LEoFjMweCdYFLAQOXfYF2jTWEARgphGo7 X-IPAS-Result: AugBAItdg1PRVdyvlGdsb2JhbABZhDGCaqpZlE4BgQsIFg4BAQEBBwsLCRIqgiUBAQEEEhEdARsdAQMMBgULDQICJgICIQEBEQEFARwGEwgaiAsBAxGjTWqLJ4Fygw2ZbwoZJw1khTYRAQUMgR6LEoFjMweCdYFLAQOXfYF2jTWEARgphGo7 X-IronPort-AV: E=Sophos;i="4.98,913,1392159600"; d="scan'208";a="64192693" Received: from mail-vc0-f175.google.com ([209.85.220.175]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 26 May 2014 17:34:14 +0200 Received: by mail-vc0-f175.google.com with SMTP id id10so5935553vcb.20 for ; Mon, 26 May 2014 08:34:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=9WhlzkSPHyyHgmV6w1qlCAfDMwUZlJ4LZkVv0Hol5Jo=; b=RHKb9h9nPaJaIbrIbIE39o5BlVdjSZGqmtZSfiQArtKzmU6P1miSDXjrtB+sZUlPC9 ubu/iEBfFqnH5M746YVe+/28Ny4aUeiJKQQaEpMCgK46plDVP5pN/jJiw5u+JoyVN2vm LzWGCcjpfAOm05tuWVVbPu2tgU9x5kXQMIFehvkQajMKVsHzYh8YpZwvhKpEn5uWOLU+ Zu9oUolWa0yPCBf7ETvLXWjq2F3mfNSjWJN+Z3i9q4GjyGihlUI0E69L1p38fj+vlppg d+saa1LzREJOsMDaWtG6XUdjIIN0Ut64hut0lU20n4yw2ObEPuLhZmWEXMESQ3OPhliB E3yA== X-Received: by 10.58.135.136 with SMTP id ps8mr21809599veb.18.1401118451460; Mon, 26 May 2014 08:34:11 -0700 (PDT) MIME-Version: 1.0 Received: by 10.58.90.227 with HTTP; Mon, 26 May 2014 08:33:31 -0700 (PDT) In-Reply-To: References: From: Gabriel Scherer Date: Mon, 26 May 2014 17:33:31 +0200 Message-ID: To: Philippe Veber Cc: caml users Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Caml-list] Uncaught exceptions in function type. The problem is with functions taken as parameter. What would be the exception signature of List.map? This work has already been done by Fran=C3=A7ois Pessaux in the "ocamlexc" project, using row variables to infer convenient exception typings. The problem is that he basically had to re-implement a full type-checker for OCaml to do this, which grew unmaintained (it was a PhD work) and is probably unusable today. There is of course interest in reviving it (looking for simpler or integrated-upstream approaches to reduce the maintenance burden), and he recently made the ocamlexc sources available online for this purpose. If anyone is tempted to contribute... On Mon, May 26, 2014 at 4:23 PM, Philippe Veber wrote: > Hi everyone, > > Out of curiosity, I was wondering how difficult it would be in theory to > extend the type system so that exceptions that can pop out of a function > when it is called would be included in the type of the function. Could th= is > type information be infered automatically? Could this be used to have an > exhaustivity check in the "with" part of a try ... with expression? > > I guess that if it was so easy, we would already be enjoying it within our > favorite compiler, but I fail to see how hairy is the question. > > Cheers, > Philippe. > >