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 (12:40)
From: Bünzli_Daniel <daniel.buenzli@e...>
Subject: Re: [Caml-list] [OSR] Exceptionless error management, take 2

Le 8 févr. 08 à 12:56, Vincent Hanquez a écrit :

> For example, an `Error returned by module X could be use in a code
> expecting an `Error returned by module Y, even though that the `Error
> could means something totally different (semanticly).

Only if they have exactly the same error cases (in which case they are  
very likely to attach the same semantics to it). I think you fail to  
think realisitically, chances are little that this is going to pose  
any problems in practice. Do you redefine the option type in each of  
your modules to be able to say this is an optional integer from module  
X ?

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