Participants to this discussion may be interested in the article "Catch me if you can", by David Teller, Arnaud Spiwack and Till Varoquaux, 2008:

  https://hal.inria.fr/inria-00432575

This is the year 2008 and ML-style exceptions are everywhere. Most modern languages, whether academic or industrial, feature some variant of this mechanism. Languages such as Java even feature static coverage-checking for such exceptions, something not available for ML languages, at least not without resorting to external tools. In this document, we demonstrate a design principle and a tiny library for managing errors in a functional manner, with static coverage-checking, automatically-inferred, structurally typed and hierarchical exceptional cases, with a reasonable run-time penalty. Our work is based on OCaml and features monads, polymorphic variants, compile-time code rewriting and trace elements of black magic.

On Tue, Oct 24, 2017 at 1:11 PM, SP <sp@orbitalfox.com> wrote:
On 22/10/2017 13:39, Malcolm Matalka wrote:
> I'm one of those people that uses result everywhere + result monad where
> the error case is a polymorphic variant.  This lets me get the value of
> an open type with power of an exhaustive pattern match check.  No
> strings needed.

Nice!

--
    SP

--
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