aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/option.ml7
-rw-r--r--lib/option.mli6
2 files changed, 6 insertions, 7 deletions
diff --git a/lib/option.ml b/lib/option.ml
index 5539058136..95a18396bb 100644
--- a/lib/option.ml
+++ b/lib/option.ml
@@ -100,10 +100,9 @@ let fold_right f x a =
(** {6 More Specific operations} ***)
-(** [default f x a] is [f y] if [x] is [Some y] and [a] otherwise. *)
-let default f x a =
- match x with
- | Some y -> f y
+(** [default a x] is [y] if [x] is [Some y] and [a] otherwise. *)
+let default a = function
+ | Some y -> y
| _ -> a
(** [lift f x] is the same as [map f x]. *)
diff --git a/lib/option.mli b/lib/option.mli
index 4047ebe1a2..c1260d9acf 100644
--- a/lib/option.mli
+++ b/lib/option.mli
@@ -69,10 +69,10 @@ val fold_right : ('a -> 'b -> 'b) -> 'a option -> 'b -> 'b
(** {6 More Specific Operations} ***)
-(** [default f x a] is [f y] if [x] is [Some y] and [a] otherwise. *)
-val default : ('a -> 'b) -> 'a option -> 'b -> 'b
+(** [default a x] is [y] if [x] is [Some y] and [a] otherwise. *)
+val default : 'a -> 'a option -> 'a
-(** [lift f x] is the same as [map f x]. *)
+(** [lift] is the same as {!map}. *)
val lift : ('a -> 'b) -> 'a option -> 'b option
(** [lift_right f a x] is [Some (f a y)] if [x] is [Some y], and