We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
CCOpt.{some,none}
1 parent 1f92564 commit 25660eeCopy full SHA for 25660ee
src/core/CCOpt.ml
@@ -37,6 +37,8 @@ let equal f o1 o2 = match o1, o2 with
37
| Some x, Some y -> f x y
38
39
let return x = Some x
40
+let some = return
41
+let none = None
42
43
let[@inline] flat_map f o = match o with
44
| None -> None
src/core/CCOpt.mli
@@ -34,6 +34,14 @@ val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool
34
val return : 'a -> 'a t
35
(** [return x] is a monadic return, that is [return x = Some x]. *)
36
+val some : 'a -> 'a t
+(** Alias to {!return}.
+ @since NEXT_RELEASE *)
+
+val none : 'a t
+(** Alias to {!None}.
45
val (>|=) : 'a t -> ('a -> 'b) -> 'b t
46
(** [o >|= f] is the infix version of {!map}. *)
47
0 commit comments