caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Gabriel Scherer <gabriel.scherer@gmail.com>
To: Philippe Veber <philippe.veber@gmail.com>
Cc: caml users <caml-list@inria.fr>
Subject: Re: [Caml-list] Uncaught exceptions in function type.
Date: Mon, 26 May 2014 17:33:31 +0200	[thread overview]
Message-ID: <CAPFanBG2jLRMnHFoyvh7rfRYP98J3DzBBnauK2J2RGJVZB3uKw@mail.gmail.com> (raw)
In-Reply-To: <CAOOOohTKWk6gsz2MFqMniK0MLenRmdvsh8hG1hjqO2cXQJxj0Q@mail.gmail.com>

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çois 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
<philippe.veber@gmail.com> 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 this
> 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.
>
>

      parent reply	other threads:[~2014-05-26 15:34 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-26 14:23 Philippe Veber
2014-05-26 14:56 ` Romain Bardou
2014-05-26 15:13   ` Ben Millwood
2014-05-26 16:02     ` Philippe Veber
2014-05-26 16:34       ` Daniel Bünzli
2014-05-27  6:52         ` Philippe Veber
2014-05-27  8:42           ` Ben Millwood
2014-05-27 10:05             ` Goswin von Brederlow
2014-05-27 10:36               ` Ben Millwood
2014-05-27 11:24                 ` Yaron Minsky
2014-05-27 21:42             ` Daniel Bünzli
2014-05-27 21:16           ` Daniel Bünzli
2014-06-02  8:38             ` Goswin von Brederlow
2014-05-27  8:49         ` Goswin von Brederlow
2014-05-27  8:56           ` David House
2014-05-27 21:39           ` Daniel Bünzli
2014-06-02  8:31             ` Goswin von Brederlow
2014-05-27  9:25         ` Nicolas Boulay
2014-05-27 21:51           ` Daniel Bünzli
2014-05-30 18:03         ` Florian Weimer
2014-05-31 11:26           ` Daniel Bünzli
2014-06-02  8:43             ` Goswin von Brederlow
2014-05-26 15:25   ` Philippe Veber
2014-05-27  9:28     ` Goswin von Brederlow
2014-05-27  9:38       ` Romain Bardou
2014-05-26 15:33 ` Thomas Blanc
2014-05-26 16:04   ` Philippe Veber
2014-05-26 15:33 ` Gabriel Scherer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAPFanBG2jLRMnHFoyvh7rfRYP98J3DzBBnauK2J2RGJVZB3uKw@mail.gmail.com \
    --to=gabriel.scherer@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=philippe.veber@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).