From: Olivier A. <ol...@us...> - 2003-02-28 08:57:44
|
> > (* given a 'a option returns the 'a value if it's Some _ or raise an > > exception, find a better name! *) > > - val unsome : 'a option -> 'a > > Global is much more complete Huh ?? that's not the same thing at all ... This kind of function is useful when dealing with optional arguments. There's more of this kind of fonctions (manipulating 'a option values) : let may f = function | None -> () | Some v -> f v let may_map f = function | None -> None | Some v -> Some (f v) let is = function | None -> false | Some _ -> true let default x = function | None -> x | Some v -> v -- Olivier |