1) For [get_exn], I reason that, with ExtLib's conventions, when writing
a module for a new data structure, one often has to write two functions:
* some_kind_of_get : 'a t -> 'a option
* some_kind_of_get': 'a t -> 'a (**raises [ThisModule.NotFound] *)
Having [Option.get_exn] makes it possible to write the second function
from the first one as a (real) one-liner.
2) For [Option.enum], it's not a big deal, just a matter of
uniformisation wrt other containers. I consider also adding [iter] and
On Sun, 2008-05-18 at 23:28 +0300, Janne Hellsten wrote:
> Hi David,
> What kind of example uses did you have in mind for the Option
> Not sure if I agree that get_exn is too useful an addition. If
> Not_found for the (often erroneous) case of (Option.get None) is not
> generic enough, couldn't you just match the option and throw the
> exception yourself:
> match o with None -> raise your_exception | Some f -> f
> What's the use case for Option.enum?
Security of Distributed Systems
Angry researcher: French Universities need reforms, but the LRU act brings liquidations.