caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Philippe Veber <philippe.veber@gmail.com>
To: Romain Bardou <romain.bardou@inria.fr>
Cc: caml users <caml-list@inria.fr>
Subject: Re: [Caml-list] Uncaught exceptions in function type.
Date: Mon, 26 May 2014 17:25:21 +0200	[thread overview]
Message-ID: <CAOOOohQyNaO5SUVkxzZuZbVW7Jw_m-36nzhDBXvJF99UG-UvHQ@mail.gmail.com> (raw)
In-Reply-To: <53835610.9050609@inria.fr>

[-- Attachment #1: Type: text/plain, Size: 1848 bytes --]

Hi Romain!


> Some issues:
>
> - One needs to separate exceptions into two groups, the ones that you
> are actually interested in typing (their purpose is to kill the program,
> so to speak) and the ones that you are not (they are actually used for
> control flow).
>
I would not like such a separation, unless the user can decide the kind of
each exception (did you say burdensome? ;o). This kind of separation is
pretty much the reason why there are errors and exceptions in Java, IIRC.


>
> - I'm not sure it is easy to infer. For instance, in:
>
> let f g =
>   g 1
>
> should we just assume that g raises nothing?

No, we should assume g raises something, and that f raises the same.


> Or should we use some kind
> of row variable, like:
>
> let f (g: 'a raise ([< ] as 'raises): 'b raise 'raises =
>   g 1
>

Yes more like that


>
> But then what about:
>
> let f
>     (g: 'a raise ([< ] as 'raises_h)
>     (h: 'a raise ([< ] as 'raises_g): 'b raise [ 'raises_g | 'raises_h ] =
>   g 1 + h 2
>
> is it sound to have those abstract union types [ 'raises_g | 'raises_h ]?
>

I guess it is not easy because 'raises_g and 'raises_h may have
incompatibilities (same constructors with different arguments). Since you
worked on union of abstract polymorphic variant types, I guess you know
pretty well how difficult that would be ;o).


>
> Do we want all functions to have these convoluted types?
>
Representing those types could be optional most of the time. The only place
where they would be important would when catching exceptions, to have the
compiler check for exhaustivity.


>
> --
> Romain Bardou
>
> --
> Caml-list mailing list.  Subscription management and archives:
> https://sympa.inria.fr/sympa/arc/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>

[-- Attachment #2: Type: text/html, Size: 3255 bytes --]

  parent reply	other threads:[~2014-05-26 15:25 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 [this message]
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

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=CAOOOohQyNaO5SUVkxzZuZbVW7Jw_m-36nzhDBXvJF99UG-UvHQ@mail.gmail.com \
    --to=philippe.veber@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=romain.bardou@inria.fr \
    /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).