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-07 (16:23)
From: David Teller <David.Teller@u...>
Subject: Re: [Caml-list] [OSR] Exceptionless error management, take 2
You're correct: if I do specify manually in the interface that the type
of parse_int is 
 string -> (int, [`Syntax | `Overflow]) may_fail
rather than the inferred
 string -> (int, [> `Syntax | `Overflow) may_fail
I will be safe. I hadn't paid attention to that. I'll rectify my

I still believe that's one pitfall too many but yes, the pitfall is much
smaller than what I had in mind.


On Thu, 2008-02-07 at 17:06 +0100, Olivier Andrieu wrote:
> Err no, it's not, you'll get a type error since the variant is closed
> in the signature of parse_int:
> This pattern matches values of type (int, [> `IncorrectSyntax ])
> may_fail
> but is here used to match values of type
>   (int, [ `Overflow | `Syntax ]) may_fail
> The second variant type does not allow tag(s) `IncorrectSyntax
David Teller
 Security of Distributed Systems
 Angry researcher: French Universities need reforms, but the LRU act
brings liquidations.