From: Nicolas C. <war...@fr...> - 2003-02-28 10:24:23
|
> > > (* 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 Hum sorry :) It was in the same thread so I messed up... Theses are nices, but what package would they belong to ? Nicolas Cannasse |