Commits

camlspotter committed 6ce2732

added Option

  • Participants
  • Parent commits 2d6b651
  • Branches ocamlspot

Comments (0)

Files changed (1)

File ocamlspot/utils.ml

     else Format.fprintf ppf "lazy"
 end
 
+module Option = struct
+  let map ~f = function
+    | None -> None
+    | Some v -> Some (f v)
+
+  let bind v f = match v with
+    | None -> None
+    | Some v -> f v
+
+  let iter ~f = function
+    | None -> ()
+    | Some v -> f v
+end
+
+