diff --git a/src/core/CCOption.ml b/src/core/CCOption.ml index 5a6b50a4..39784c66 100644 --- a/src/core/CCOption.ml +++ b/src/core/CCOption.ml @@ -54,10 +54,9 @@ let[@inline] flat_map_l f o = let[@inline] bind o f = flat_map f o let ( >>= ) = bind let pure x = Some x - let k_compose f g x = f x |> flat_map g let ( >=> ) = k_compose -let ( <=< ) f g = g >=> f +let ( <=< ) f g = g >=> f let ( <*> ) f x = match f, x with @@ -202,9 +201,7 @@ module Infix = struct | _ -> None let ( and* ) = ( and+ ) - let ( >=> ) = ( >=> ) - let ( <=< ) = ( <=< ) end diff --git a/src/core/CCOption.mli b/src/core/CCOption.mli index bc921ee6..901ba892 100644 --- a/src/core/CCOption.mli +++ b/src/core/CCOption.mli @@ -194,7 +194,7 @@ module Infix : sig val ( >=> ) : ('a -> 'b t) -> ('b -> 'c t) -> 'a -> 'c t (** Monadic [k_compose]. *) - + val ( <=< ) : ('b -> 'c t) -> ('a -> 'b t) -> 'a -> 'c t (** Reverse monadic [k_compose]. *) end diff --git a/src/core/CCResult.ml b/src/core/CCResult.ml index 1706951f..69bbab60 100644 --- a/src/core/CCResult.ml +++ b/src/core/CCResult.ml @@ -133,9 +133,8 @@ let flat_map f e = | Error s -> Error s let k_compose f g x = f x |> flat_map g - let ( >=> ) = k_compose -let ( <=< ) f g = g >=> f +let ( <=< ) f g = g >=> f let equal ~err eq a b = match a, b with @@ -288,7 +287,6 @@ module Infix = struct | _, Error e -> Error e let ( and* ) = ( and+ ) - let ( >=> ) = ( >=> ) let ( <=< ) = ( <=< ) end diff --git a/src/core/CCResult.mli b/src/core/CCResult.mli index a5f7e6c0..0b11887e 100644 --- a/src/core/CCResult.mli +++ b/src/core/CCResult.mli @@ -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 k_compose : +val k_compose : ('a -> ('b, 'err) t) -> ('b -> ('c, 'err) t) -> 'a -> ('c, 'err) t (** Kleisli composition. Monadic equivalent of CCFun.compose *) @@ -216,7 +216,7 @@ module Infix : sig val ( >=> ) : ('a -> ('b, 'err) t) -> ('b -> ('c, 'err) t) -> 'a -> ('c, 'err) t (** Monadic [k_compose]. *) - + val ( <=< ) : ('b -> ('c, 'err) t) -> ('a -> ('b, 'err) t) -> 'a -> ('c, 'err) t (** Reverse monadic [k_compose]. *)