mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 03:05:28 -05:00
format
This commit is contained in:
parent
e933995733
commit
cb14c0d04b
4 changed files with 5 additions and 10 deletions
|
|
@ -54,10 +54,9 @@ let[@inline] flat_map_l f o =
|
||||||
let[@inline] bind o f = flat_map f o
|
let[@inline] bind o f = flat_map f o
|
||||||
let ( >>= ) = bind
|
let ( >>= ) = bind
|
||||||
let pure x = Some x
|
let pure x = Some x
|
||||||
|
|
||||||
let k_compose f g x = f x |> flat_map g
|
let k_compose f g x = f x |> flat_map g
|
||||||
let ( >=> ) = k_compose
|
let ( >=> ) = k_compose
|
||||||
let ( <=< ) f g = g >=> f
|
let ( <=< ) f g = g >=> f
|
||||||
|
|
||||||
let ( <*> ) f x =
|
let ( <*> ) f x =
|
||||||
match f, x with
|
match f, x with
|
||||||
|
|
@ -202,9 +201,7 @@ module Infix = struct
|
||||||
| _ -> None
|
| _ -> None
|
||||||
|
|
||||||
let ( and* ) = ( and+ )
|
let ( and* ) = ( and+ )
|
||||||
|
|
||||||
let ( >=> ) = ( >=> )
|
let ( >=> ) = ( >=> )
|
||||||
|
|
||||||
let ( <=< ) = ( <=< )
|
let ( <=< ) = ( <=< )
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -194,7 +194,7 @@ module Infix : sig
|
||||||
|
|
||||||
val ( >=> ) : ('a -> 'b t) -> ('b -> 'c t) -> 'a -> 'c t
|
val ( >=> ) : ('a -> 'b t) -> ('b -> 'c t) -> 'a -> 'c t
|
||||||
(** Monadic [k_compose]. *)
|
(** Monadic [k_compose]. *)
|
||||||
|
|
||||||
val ( <=< ) : ('b -> 'c t) -> ('a -> 'b t) -> 'a -> 'c t
|
val ( <=< ) : ('b -> 'c t) -> ('a -> 'b t) -> 'a -> 'c t
|
||||||
(** Reverse monadic [k_compose]. *)
|
(** Reverse monadic [k_compose]. *)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -133,9 +133,8 @@ let flat_map f e =
|
||||||
| Error s -> Error s
|
| Error s -> Error s
|
||||||
|
|
||||||
let k_compose f g x = f x |> flat_map g
|
let k_compose f g x = f x |> flat_map g
|
||||||
|
|
||||||
let ( >=> ) = k_compose
|
let ( >=> ) = k_compose
|
||||||
let ( <=< ) f g = g >=> f
|
let ( <=< ) f g = g >=> f
|
||||||
|
|
||||||
let equal ~err eq a b =
|
let equal ~err eq a b =
|
||||||
match a, b with
|
match a, b with
|
||||||
|
|
@ -288,7 +287,6 @@ module Infix = struct
|
||||||
| _, Error e -> Error e
|
| _, Error e -> Error e
|
||||||
|
|
||||||
let ( and* ) = ( and+ )
|
let ( and* ) = ( and+ )
|
||||||
|
|
||||||
let ( >=> ) = ( >=> )
|
let ( >=> ) = ( >=> )
|
||||||
let ( <=< ) = ( <=< )
|
let ( <=< ) = ( <=< )
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -120,7 +120,7 @@ val catch : ('a, 'err) t -> ok:('a -> 'b) -> err:('err -> 'b) -> 'b
|
||||||
|
|
||||||
val flat_map : ('a -> ('b, 'err) t) -> ('a, 'err) t -> ('b, 'err) t
|
val flat_map : ('a -> ('b, 'err) t) -> ('a, 'err) t -> ('b, 'err) t
|
||||||
|
|
||||||
val k_compose :
|
val k_compose :
|
||||||
('a -> ('b, 'err) t) -> ('b -> ('c, 'err) t) -> 'a -> ('c, 'err) t
|
('a -> ('b, 'err) t) -> ('b -> ('c, 'err) t) -> 'a -> ('c, 'err) t
|
||||||
(** Kleisli composition. Monadic equivalent of CCFun.compose *)
|
(** Kleisli composition. Monadic equivalent of CCFun.compose *)
|
||||||
|
|
||||||
|
|
@ -216,7 +216,7 @@ module Infix : sig
|
||||||
val ( >=> ) :
|
val ( >=> ) :
|
||||||
('a -> ('b, 'err) t) -> ('b -> ('c, 'err) t) -> 'a -> ('c, 'err) t
|
('a -> ('b, 'err) t) -> ('b -> ('c, 'err) t) -> 'a -> ('c, 'err) t
|
||||||
(** Monadic [k_compose]. *)
|
(** Monadic [k_compose]. *)
|
||||||
|
|
||||||
val ( <=< ) :
|
val ( <=< ) :
|
||||||
('b -> ('c, 'err) t) -> ('a -> ('b, 'err) t) -> 'a -> ('c, 'err) t
|
('b -> ('c, 'err) t) -> ('a -> ('b, 'err) t) -> 'a -> ('c, 'err) t
|
||||||
(** Reverse monadic [k_compose]. *)
|
(** Reverse monadic [k_compose]. *)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue