CCopt.pure

This commit is contained in:
Simon Cruanes 2014-06-28 04:06:58 +02:00
parent d36e8dd38e
commit 50cc9f8d2c
2 changed files with 5 additions and 0 deletions

View file

@ -64,6 +64,8 @@ let flat_map f o = match o with
| None -> None
| Some x -> f x
let pure x = Some x
let (<*>) f x = match f, x with
| None, _
| _, None -> None

View file

@ -68,6 +68,9 @@ val sequence_l : 'a t list -> 'a list t
(** {2 Applicative} *)
val pure : 'a -> 'a t
(** Alias to {!return} *)
val (<*>) : ('a -> 'b) t -> 'a t -> 'b t
val (<$>) : ('a -> 'b) -> 'a t -> 'b t