Commits

camlspotter  committed de80eb8

incompatibility: Option.default type change

  • Participants
  • Parent commits b158229

Comments (0)

Files changed (2)

File lib/option.ml

     | None -> None
 end)
 
-let default def = function
-  | None -> def
+let default v df = match v with
+  | None -> df ()
   | Some v -> v
-
-let from = default

File lib/option.mli

 include Monad_intf.T with type 'a t = 'a option
 
-val default : 'a -> 'a t -> 'a
+val default : 'a t -> (unit -> 'a) -> 'a
   (** Haskell's fromMaybe *)
-val from : 'a -> 'a t -> 'a
-  (** Haskell's fromMaybe. Deprecated, since ``from a b'' sounds strange *)