diff --git a/src/odoc/resolver.ml b/src/odoc/resolver.ml index 2a0cdfa238..fedcfd9320 100644 --- a/src/odoc/resolver.ml +++ b/src/odoc/resolver.ml @@ -375,7 +375,7 @@ let add_unit_to_cache u = let lookup_path _ap ~pages ~libs:_ ~hierarchy (kind, tag, path) = let module Env = Odoc_xref2.Env in - let ( >>= ) x f = match x with Some x' -> f x' | None -> None in + let open Odoc_utils.OptionMonad in let page_path_to_path path = (* Turn [foo/bar] into [foo/page-bar.odoc]. *) let segs = diff --git a/src/xref2/ref_tools.ml b/src/xref2/ref_tools.ml index bcfa73d32d..9c216c2848 100644 --- a/src/xref2/ref_tools.ml +++ b/src/xref2/ref_tools.ml @@ -192,7 +192,8 @@ module Path = struct | `Page p -> Ok p let page_in_env env (tag, path) : page_lookup_result ref_result = - handle_lookup_errors ~tag ~path (Env.lookup_path (`Page, tag, path) env) + Env.lookup_path (`Page, tag, path) env + |> handle_lookup_errors ~tag ~path >>= expect_page ~tag ~path >>= fun p -> Ok (`Identifier p.name, p)