Version française
Home     About     Download     Resources     Contact us    
Browse thread
[OSR] Exceptionless error management
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: David Teller <David.Teller@u...>
Subject: Re: [Caml-list] [OSR] Exceptionless error management
On Thu, 2008-01-31 at 21:25 +0100, David Teller wrote:
> What about a generic 
> 
> type result 'r 'e =
>     | Success of 'r  (**The operation was a success*)
>     | Failure of 'e  (**The operation was a failure*) 
> 
> let purify e = 
>     try 
>       Success ( Lazy.force e )
>     with 
>       exc -> Failure exc
> 
> ?

Oh, yeah, "Failure" was perhaps the wrong name to choose, as that's
already the name of an exception. So please replace occurrences of
"Failure" with "Failed" in the previous message.

And to answer a possibly incoming comment about 'e, yeah, it isn't
needed for exceptions, although I suspect it can come in handy for
operations that are exceptionless in the first place.

Cheers,
 David
-- 
David Teller
 Security of Distributed Systems
  http://www.univ-orleans.fr/lifo/Members/David.Teller
 Angry researcher: French Universities need reforms, but the LRU act
brings liquidations.