mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-09 04:35:29 -05:00
CCOpt infix map
This commit is contained in:
parent
933638244d
commit
d368931f70
2 changed files with 5 additions and 0 deletions
|
|
@ -54,6 +54,8 @@ let equal f o1 o2 = match o1, o2 with
|
|||
|
||||
let return x = Some x
|
||||
|
||||
let (>|=) x f = map f x
|
||||
|
||||
let (>>=) o f = match o with
|
||||
| None -> None
|
||||
| Some x -> f x
|
||||
|
|
|
|||
|
|
@ -43,6 +43,9 @@ val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool
|
|||
val return : 'a -> 'a t
|
||||
(** Monadic return *)
|
||||
|
||||
val (>|=) : 'a t -> ('a -> 'b) -> 'b t
|
||||
(** Infix version of {!map} *)
|
||||
|
||||
val (>>=) : 'a t -> ('a -> 'b t) -> 'b t
|
||||
(** Monadic bind *)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue