mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 19:25:28 -05:00
parent
1f92564f83
commit
25660ee2c1
2 changed files with 10 additions and 0 deletions
|
|
@ -37,6 +37,8 @@ let equal f o1 o2 = match o1, o2 with
|
||||||
| Some x, Some y -> f x y
|
| Some x, Some y -> f x y
|
||||||
|
|
||||||
let return x = Some x
|
let return x = Some x
|
||||||
|
let some = return
|
||||||
|
let none = None
|
||||||
|
|
||||||
let[@inline] flat_map f o = match o with
|
let[@inline] flat_map f o = match o with
|
||||||
| None -> None
|
| None -> None
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,14 @@ val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool
|
||||||
val return : 'a -> 'a t
|
val return : 'a -> 'a t
|
||||||
(** [return x] is a monadic return, that is [return x = Some x]. *)
|
(** [return x] is a monadic return, that is [return x = Some x]. *)
|
||||||
|
|
||||||
|
val some : 'a -> 'a t
|
||||||
|
(** Alias to {!return}.
|
||||||
|
@since NEXT_RELEASE *)
|
||||||
|
|
||||||
|
val none : 'a t
|
||||||
|
(** Alias to {!None}.
|
||||||
|
@since NEXT_RELEASE *)
|
||||||
|
|
||||||
val (>|=) : 'a t -> ('a -> 'b) -> 'b t
|
val (>|=) : 'a t -> ('a -> 'b) -> 'b t
|
||||||
(** [o >|= f] is the infix version of {!map}. *)
|
(** [o >|= f] is the infix version of {!map}. *)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue