summaryrefslogtreecommitdiff
path: root/otherlibs/labltk/support/may.ml
blob: 202b561d9eb30efebc98880dd042a4eb9ad0df4b (plain)
1
2
3
4
5
6
7
8
9
10

(* Very easy hack for option type *)
let may f = function
  Some x -> Some (f x)
| None -> None

let maycons f x l =
  match x with
    Some x -> f x :: l
  | None -> l