mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 03:05:28 -05:00
CCopt.pure
This commit is contained in:
parent
d36e8dd38e
commit
50cc9f8d2c
2 changed files with 5 additions and 0 deletions
|
|
@ -64,6 +64,8 @@ let flat_map f o = match o with
|
||||||
| None -> None
|
| None -> None
|
||||||
| Some x -> f x
|
| Some x -> f x
|
||||||
|
|
||||||
|
let pure x = Some x
|
||||||
|
|
||||||
let (<*>) f x = match f, x with
|
let (<*>) f x = match f, x with
|
||||||
| None, _
|
| None, _
|
||||||
| _, None -> None
|
| _, None -> None
|
||||||
|
|
|
||||||
|
|
@ -68,6 +68,9 @@ val sequence_l : 'a t list -> 'a list t
|
||||||
|
|
||||||
(** {2 Applicative} *)
|
(** {2 Applicative} *)
|
||||||
|
|
||||||
|
val pure : 'a -> 'a t
|
||||||
|
(** Alias to {!return} *)
|
||||||
|
|
||||||
val (<*>) : ('a -> 'b) t -> 'a t -> 'b t
|
val (<*>) : ('a -> 'b) t -> 'a t -> 'b t
|
||||||
|
|
||||||
val (<$>) : ('a -> 'b) -> 'a t -> 'b t
|
val (<$>) : ('a -> 'b) -> 'a t -> 'b t
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue