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 (11:56)
From: tab@s...
Subject: Re: [Caml-list] [OSR] Exceptionless error management, take 2
On Fri, Feb 08, 2008 at 11:52:18AM +0100, wrote:
> Could you please expand on this "pollution" and the *practical* problems it
> causes? I can see the risk of my own identifiers clashing with those of a
> library, and that finding documentation when the namespace is flat is harder.
> But none of these seem applicable for polymorphic variants, so I feel like I'm
> missing something.

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).  If I use normal
variant, the compiler will prevent me using the same code to match a
X.Error and a Y.Error.

And don't get me wrong, i'm not saying polymorphic variant should never be use,
it has its limited use (when people knows exactly what they are doing),
but usually i prefer keeping this safety net , and like that the
compiler tells me i can't use a Y.Error like a X.Error.

Vincent Hanquez