]> matita.cs.unibo.it Git - helm.git/blob - helm/DEVEL/lablgtk/lablgtk_20000829-0.1.0/gaux.ml
Initial revision
[helm.git] / helm / DEVEL / lablgtk / lablgtk_20000829-0.1.0 / gaux.ml
1 (* $Id$ *)
2
3 (* Option handling *)
4
5 let may ~f x =
6   match x with None -> ()
7   | Some x -> let _ = f x in ()
8
9 let may_map ~f x =
10   match x with None -> None
11   | Some x -> Some (f x)
12
13 let default x ~opt =
14   match opt with None -> x | Some y -> y
15
16 let may_default f x ~opt =
17   match opt with None -> f x | Some y -> y