Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[OSR] Exceptionless error management, take 2
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2008-02-08 (15:39)
From: David Teller <David.Teller@u...>
Subject: Re: [Caml-list] [OSR] Exceptionless error management, take 2
On Fri, 2008-02-08 at 13:40 +0100, Bünzli Daniel wrote:
> Le 8 févr. 08 à 12:56, Vincent Hanquez a écrit :
> > If I use normal variant, the compiler will prevent me using the same  
> > code to match a X.Error and a Y.Error.
> Note that with this take 2 proposal -- that I personnaly find too  
> invasive and heavy weight  -- you won't get that, you will have to  
> match on Error.Error (!) instead of `Error (take 1).
> Daniel

Well, I do expect people to do a "open Error" at some point in their

You are correct that `Error is shorter than Error.Error. On the other
hand, if you intend to use `Error and `Success as a standard for
exceptionless error management, you will need to standardise the use of
these specific polymorphic variants for this specific meaning and to
either teach people how to write closed polymorphic variants or expect
them to miss errors every so often. All this in a context where one of
the main objectives is to make error-management easier and safer.

Both systems have drawbacks -- not quite surprising. I believe that
writing "open Error" if there's no ambiguity and "Error.Error" if there
is any is a small price to pay. So for the moment, I stand behind take


P.S.: Everyone, please don't let this thread degenerate into a slugfest
"polymorphic variants are way kool" vs. "polymorphic variants are

David Teller
 Security of Distributed Systems
 Angry researcher: French Universities need reforms, but the LRU act
brings liquidations.