From: Michael Ekstrand <michael+ocaml@elehack.net>
To: David Teller <David.Teller@univ-orleans.fr>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] [OSR] Exceptionless error management
Date: Thu, 31 Jan 2008 13:59:55 -0600 [thread overview]
Message-ID: <8763x9epfo.fsf@jehiel.elehack.net> (raw)
In-Reply-To: <1201807692.6565.14.camel@Blefuscu> (David Teller's message of "Thu\, 31 Jan 2008 20\:28\:12 +0100")
David Teller <David.Teller@univ-orleans.fr> writes:
> What else ? We could presumably functorize modules upon the definition
> of a error-delivery mechanism, but that might be overkill.
>
> Say
> module type ErrorMechanism = sig
> type 't; (**The type of a failure.*)
> type 'a can_fail;
> (**The type of a value that can either succeed
> and produce a result of type 'a or fail and
> produce an error of type t. *)
> value fail : t -> 'a can_fail ;
> (**Fail. Depending on the mechanism, this may
> either return some variant on option or
> throw an exception.*)
>
> value succeed : 'a -> 'a can_fail ;
> (**Succeed.*)
> end;;
This could have some interesting ramifications, such as aiding in the
construction of a condition/restart mechanism.
However, standard instantiations of these functorized modules should
probably be provided to make the common case (using the module with
one or the other standard behavior) easy.
- Michael
--
mouse, n: A device for pointing at the xterm in which you want to type.
Confused by the strange files? I cryptographically sign my messages.
For more information see <http://www.elehack.net/resources/gpg>.
next prev parent reply other threads:[~2008-01-31 20:00 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-31 8:55 Bünzli Daniel
2008-01-31 9:57 ` [Caml-list] " Till Varoquaux
2008-01-31 11:01 ` Bünzli Daniel
2008-01-31 14:09 ` Andrej Bauer
2008-01-31 14:16 ` Michael Ekstrand
2008-01-31 19:28 ` David Teller
2008-01-31 19:59 ` Michael Ekstrand [this message]
2008-01-31 20:05 ` blue storm
2008-01-31 20:03 ` Bünzli Daniel
2008-01-31 20:25 ` David Teller
2008-01-31 20:40 ` David Teller
2008-01-31 21:16 ` Bünzli Daniel
2008-01-31 21:31 ` David Teller
2008-01-31 21:35 ` Jon Harrop
2008-01-31 22:01 ` Christophe Raffalli
2008-02-01 7:27 ` Michaël Grünewald
2008-02-01 7:47 ` Bünzli Daniel
2008-02-01 10:50 ` Till Varoquaux
2008-02-01 11:31 ` Bünzli Daniel
2008-02-01 15:59 ` Vincent Hanquez
2008-02-01 18:37 ` Bünzli Daniel
2008-02-01 19:43 ` Vincent Hanquez
2008-02-01 16:04 ` David Allsopp
2008-02-01 8:31 ` David Teller
2008-02-01 12:19 ` Yaron Minsky
2008-02-05 10:00 ` David Teller
2008-02-05 10:12 ` Vincent Hanquez
2008-02-05 10:26 ` Bünzli Daniel
2008-02-05 11:06 ` Vincent Hanquez
2008-02-05 13:46 ` Jon Harrop
2008-02-05 11:36 ` Frédéric van der Plancke
2008-02-06 8:45 ` Michaël Grünewald
2008-02-08 13:09 ` Bünzli Daniel
2008-02-05 14:12 ` David Teller
2008-02-11 8:12 ` David Teller
2008-02-11 9:09 ` Bünzli Daniel
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=8763x9epfo.fsf@jehiel.elehack.net \
--to=michael+ocaml@elehack.net \
--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