Summary: And add Monad.Make to implement the full interface from return and bind. Reviewed By: ngorogiannis Differential Revision: D24532341 fbshipit-source-id: 5740ba1c2master
parent
98aee0837e
commit
90675ca33a
@ -0,0 +1,25 @@
|
|||||||
|
(*
|
||||||
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*)
|
||||||
|
|
||||||
|
module type S = sig
|
||||||
|
type 'a t
|
||||||
|
|
||||||
|
val return : 'a -> 'a t
|
||||||
|
val bind : 'a t -> f:('a -> 'b t) -> 'b t
|
||||||
|
val map : 'a t -> f:('a -> 'b) -> 'b t
|
||||||
|
val ap : ('a -> 'b) t -> 'a t -> 'b t
|
||||||
|
val prod : 'a t -> 'b t -> ('a * 'b) t
|
||||||
|
|
||||||
|
module Import : sig
|
||||||
|
val ( |>= ) : 'a t -> ('a -> 'b) -> 'b t
|
||||||
|
val ( >>= ) : 'a t -> ('a -> 'b t) -> 'b t
|
||||||
|
val ( let* ) : 'a t -> ('a -> 'b t) -> 'b t
|
||||||
|
val ( and* ) : 'a t -> 'b t -> ('a * 'b) t
|
||||||
|
val ( let+ ) : 'a t -> ('a -> 'b) -> 'b t
|
||||||
|
val ( and+ ) : 'a t -> 'b t -> ('a * 'b) t
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in new issue