Browse thread
[OSR] Exceptionless error management, take 2
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ 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, 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 recommendation. I still believe that's one pitfall too many but yes, the pitfall is much smaller than what I had in mind. Cheers, David 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 http://www.univ-orleans.fr/lifo/Members/David.Teller Angry researcher: French Universities need reforms, but the LRU act brings liquidations.