From: Jesse G. <je...@wi...> - 2004-08-10 17:14:48
|
Richard Jones wrote: > On Tue, Aug 10, 2004 at 11:22:05AM -0400, Jesse Guardiani wrote: >> let incr = function >> | None -> raise No_value >> | Some v -> Some (v+1) >> >> Useful? > > You can implement it fairly trivially using 'Option.get' and/or > 'Option.map' ... Sure. But this: Some ((Option.get var) + 1) Is a lot harder to write than this: Option.incr var -- Jesse Guardiani, Systems Administrator WingNET Internet Services, P.O. Box 2605 // Cleveland, TN 37320-2605 423-559-LINK (v) 423-559-5145 (f) http://www.wingnet.net |