From: "Yaron Minsky" <yminsky@gmail.com>
To: "David Teller" <David.Teller@univ-orleans.fr>
Cc: OCaml <caml-list@inria.fr>
Subject: Re: [Caml-list] [OSR] Exceptionless error management, take 2
Date: Sun, 10 Feb 2008 13:47:05 -0500 [thread overview]
Message-ID: <891bd3390802101047o187a94fch8f66a6c8a457d391@mail.gmail.com> (raw)
In-Reply-To: <1202396482.6084.5.camel@Blefuscu>
[-- Attachment #1: Type: text/plain, Size: 1899 bytes --]
A couple of quick thoughts about the proposal:
- I don't understand the motivation behind separating out may_fail and
status. In the case where no explicit error is returned, we're happy to
return an ordinary option. Why not return a status when we want to return
an error condition? And I don't understand the argument about wanting to
delay evaluation until the function result is called. Why is that good, and
if it's good, why do we still support functions that return options? The
whole thing seems to add verbosity with little gain.
- I think some attention on nomenclature is in order. In the
libraries Jane Street uses, we have something similar to status (called
"result"), but the type is "Ok of 'a | Error of 'b" rather than "Success of
'a | Error of 'b", simply for terseness. Also, having a function called
"result" which converts a "may_fail" into a "status" seems like one name too
many. I would call both the function and the type the same thing (either
status or result). Unless, of course, you want to imply something material
about the operation, in which case calling it "eval" or somesuch would make
sense.
- I don't understand why this proposal is only for functional data
types. I didn't find the motivation given in the OSR for this convincing.
I feel like the use of exceptions involves roughly the same tradeoffs when
you're using imperative and functional code. If you have long functional
pipelines, doing exception handling at each stage is a pain, much as it is
if you do long sequences of imperative operations. That's why I think the
goal should not be for the interfaces to be "exceptionless" so much as to
make it easier to keep track of where exceptions might and might not be
thrown, so that the reader of a piece of code knows where to stop and worry
about exceptions.
y
[-- Attachment #2: Type: text/html, Size: 2045 bytes --]
next prev parent reply other threads:[~2008-02-10 18:47 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-07 15:01 David Teller
2008-02-07 15:09 ` [Caml-list] " Vincent Hanquez
2008-02-07 16:40 ` David Teller
2008-02-07 15:17 ` Jacques Garrigue
2008-02-07 15:22 ` Jon Harrop
2008-02-08 9:54 ` Vincent Hanquez
2008-02-07 15:52 ` David Teller
2008-02-07 16:06 ` Olivier Andrieu
2008-02-07 16:23 ` David Teller
2008-02-08 9:53 ` Vincent Hanquez
2008-02-08 10:52 ` rlehy
2008-02-08 11:56 ` Vincent Hanquez
2008-02-08 12:40 ` Bünzli Daniel
2008-02-08 15:39 ` David Teller
2008-02-08 17:06 ` Eric Cooper
2008-02-08 20:02 ` David Teller
2008-02-08 19:29 ` Bünzli Daniel
2008-02-08 21:13 ` David Teller
2008-02-10 12:35 ` Vincent Hanquez
2008-02-08 19:07 ` Jon Harrop
2008-02-10 11:58 ` Vincent Hanquez
2008-02-10 16:51 ` Matthew William Cox
2008-02-07 15:33 ` Jon Harrop
2008-02-07 16:25 ` David Teller
2008-02-07 23:10 ` David Teller
2008-02-10 18:47 ` Yaron Minsky [this message]
2008-02-10 22:05 ` David Teller
2008-02-11 2:16 ` Yaron Minsky
2008-02-11 8:45 ` David Teller
2008-02-11 12:12 ` Yaron Minsky
2008-02-11 12:53 ` David Teller
2008-02-11 23:09 ` Yaron Minsky
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=891bd3390802101047o187a94fch8f66a6c8a457d391@mail.gmail.com \
--to=yminsky@gmail.com \
--cc=David.Teller@univ-orleans.fr \
--cc=caml-list@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