diff --git a/src/lib_base/skip_list.ml b/src/lib_base/skip_list.ml index 1774541ceda9a7c1558a6d8c76b59f6f11f64553..e6a25cb6f3dbdda81294fec854333e7a443914a7 100644 --- a/src/lib_base/skip_list.ml +++ b/src/lib_base/skip_list.ml @@ -387,7 +387,7 @@ end) : S = struct let ( let* ) = bind module Option = struct - let (return [@ocaml.inline "always"]) = fun x -> M.return (Some x) + let[@ocaml.inline always] return x = M.return (Some x) let ( let* ) lo f = M.bind lo (function None -> M.return None | Some x -> f x) @@ -600,7 +600,7 @@ end) : S = struct include Make_monadic (struct type 'a t = 'a - let (bind [@ocaml.inline "always"]) = ( |> ) + let bind = ( |> ) let[@ocaml.inline always] return x = x end) diff --git a/src/lib_lwt_result_stdlib/bare/structs/monad.ml b/src/lib_lwt_result_stdlib/bare/structs/monad.ml index c0d0f7b97883789c8e26ed62b0cdb408820af0c2..ad2c15d777a3dfeebc2234ccf191455eb138f1db 100644 --- a/src/lib_lwt_result_stdlib/bare/structs/monad.ml +++ b/src/lib_lwt_result_stdlib/bare/structs/monad.ml @@ -39,9 +39,9 @@ module Lwt_syntax = struct end module Option_syntax = struct - let (return [@ocaml.inline "always"]) = fun x -> Some x + let[@ocaml.inline always] return x = Some x - let (fail [@ocaml.inline "always"]) = None + let fail = None let return_unit = return () @@ -63,9 +63,9 @@ module Option_syntax = struct end module Result_syntax = struct - let (return [@ocaml.inline "always"]) = fun x -> Ok x + let[@ocaml.inline always] return x = Ok x - let (fail [@ocaml.inline "always"]) = fun x -> Error x + let[@ocaml.inline always] fail x = Error x let return_unit = Ok () @@ -109,9 +109,9 @@ module Result_syntax = struct end module Lwt_option_syntax = struct - let (return [@ocaml.inline "always"]) = fun x -> Lwt.return_some x + let[@ocaml.inline always] return x = Lwt.return_some x - let (fail [@ocaml.inline "always"]) = Lwt.return None + let fail = Lwt.return None let return_unit = Lwt_syntax.return_some () @@ -140,9 +140,9 @@ module Lwt_option_syntax = struct end module Lwt_result_syntax = struct - let (return [@ocaml.inline "always"]) = fun x -> Lwt.return (Ok x) + let[@ocaml.inline always] return x = Lwt.return (Ok x) - let (fail [@ocaml.inline "always"]) = fun x -> Lwt.return (Error x) + let[@ocaml.inline always] fail x = Lwt.return (Error x) let return_unit = Lwt_syntax.return_ok_unit @@ -188,8 +188,8 @@ end (* For internal use only, not advertised *) (* Like Lwt.apply but specialised for two-parameters functions *) -let (lwt_apply2 [@ocaml.inline "always"]) = - fun f x y -> try f x y with exn -> Lwt.fail exn +let[@ocaml.inline always] lwt_apply2 f x y = + try f x y with exn -> Lwt.fail exn -let (lwt_apply3 [@ocaml.inline "always"]) = - fun f a x y -> try f a x y with exn -> Lwt.fail exn +let[@ocaml.inline always] lwt_apply3 f a x y = + try f a x y with exn -> Lwt.fail exn diff --git a/src/lib_lwt_result_stdlib/traced/structs/monad.ml b/src/lib_lwt_result_stdlib/traced/structs/monad.ml index 49cd677f44b74346724c774006b1ec1190c6e20f..683756da905ca7b504532336106eb8e90ebe06a8 100644 --- a/src/lib_lwt_result_stdlib/traced/structs/monad.ml +++ b/src/lib_lwt_result_stdlib/traced/structs/monad.ml @@ -32,7 +32,7 @@ module Make (Trace : Traced_sigs.Trace.S) : module Traced_result_syntax = struct include Result_syntax - let (fail [@ocaml.inline "always"]) = fun e -> fail (Trace.make e) + let[@ocaml.inline always] fail e = fail (Trace.make e) let rec join_errors trace_acc = function | Ok _ :: ts -> join_errors trace_acc ts @@ -66,7 +66,7 @@ module Make (Trace : Traced_sigs.Trace.S) : module Lwt_traced_result_syntax = struct include Lwt_result_syntax - let (fail [@ocaml.inline "always"]) = fun e -> fail (Trace.make e) + let[@ocaml.inline always] fail e = fail (Trace.make e) let join ts = let open Lwt_syntax in