···44 output the result to. *)
5566open Odoc_utils
77+open ResultMonad
78module List = ListLabels
89open Odoc_odoc
910open Cmdliner
···225226 let compile hidden directories resolve_fwd_refs dst output_dir package_opt
226227 parent_name_opt parent_id_opt open_modules children input warnings_options
227228 unique_id short_title =
228228- let open Or_error in
229229 let _ =
230230 match unique_id with
231231 | Some id -> Odoc_model.Names.set_unique_ident id
···476476end
477477478478module Indexing = struct
479479- open Or_error
480480-481479 let output_file ~dst marshall =
482480 match (dst, marshall) with
483481 | Some file, `JSON
···578576end
579577580578module Sidebar = struct
581581- open Or_error
582582-583579 let output_file ~dst marshall =
584580 match (dst, marshall) with
585581 | Some file, `JSON when not (Fpath.has_ext "json" (Fpath.v file)) ->
···669665 | Some file -> Fs.File.of_string file
670666 | None -> Fs.File.(set_ext ".odocl" input)
671667672672- open Or_error
673673-674668 (** Find the package/library name the output is part of *)
675669 let find_root_of_input l o =
676670 let l =
···14751469 | Some p -> Format.fprintf pp "%a/" fmt_page p
1476147014771471 let list_dependencies input_file =
14781478- let open Or_error in
14791472 Depends.for_rendering_step (Fs.Directory.of_string input_file)
14801473 >>= fun depends ->
14811474 List.iter depends ~f:(fun (root : Odoc_model.Root.t) ->
···15591552end
1560155315611554module Occurrences = struct
15621562- open Or_error
15631563-15641555 let dst_of_string s =
15651556 let f = Fs.File.of_string s in
15661557 if not (Fs.File.has_ext ".odoc-occurrences" f) then
···16521643module Odoc_error = struct
16531644 let errors input =
16541645 let open Odoc_odoc in
16551655- let open Or_error in
16561646 let input = Fs.File.of_string input in
16571647 Odoc_file.load input >>= fun unit ->
16581648 Odoc_model.Error.print_errors unit.warnings;
···1414 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1515 *)
16161717+open Odoc_utils
1718open Odoc_model
1819open Odoc_model.Paths
1919-open Or_error
20202121type package_spec = { package : string; output : Fpath.t }
2222type parent_spec = {
+2-1
src/odoc/depends.ml
···1414 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1515 *)
16161717+open Odoc_utils
1818+open ResultMonad
1719open StdLabels
1818-open Or_error
19202021module Odoc_compile = Compile
2122
+1-1
src/odoc/depends.mli
···1414 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1515 *)
16161717-open Or_error
1717+open Odoc_utils
18181919(** Computes the dependencies required for each step of the pipeline to work
2020 correctly on a given input. *)
···11-open Or_error
11+open Odoc_utils
2233(*
44 * Copyright (c) 2016 Thomas Refis <trefis@janestreet.com>
···2323type directory
24242525module Directory : sig
2626- open Or_error
2727-2826 type t = directory
29273028 val dirname : t -> t
+1-1
src/odoc/html_fragment.ml
···11open Odoc_utils
22-open Or_error
22+open ResultMonad
3344let from_mld ~xref_base_uri ~resolver ~output ~warnings_options input =
55 (* Internal names, they don't have effect on the output. *)
+1-1
src/odoc/html_fragment.mli
···1414 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1515 *)
16161717-open Or_error
1717+open Odoc_utils
18181919(** Produces html fragment files from a mld file. *)
2020
···16161717(** Load and save [.odoc] and [.odocl] files. *)
18181919+open Odoc_utils
1920open Odoc_model
2020-open Or_error
21212222(** Either a page or a module or something else. *)
2323type content =
+2-1
src/odoc/odoc_link.ml
···11-open Or_error
11+open Odoc_utils
22+open ResultMonad
2334let link_page ~resolver ~filename page =
45 let env = Resolver.build_env_for_page resolver page in
-7
src/odoc/or_error.ml
···11-type msg = [ `Msg of string ]
22-33-let ( >>= ) = Result.bind
44-55-let rec fold_list f acc = function
66- | [] -> Ok acc
77- | hd :: tl -> f acc hd >>= fun acc -> fold_list f acc tl
-6
src/odoc/or_error.mli
···11-type msg = [ `Msg of string ]
22-33-val ( >>= ) : ('a, 'e) result -> ('a -> ('b, 'e) result) -> ('b, 'e) result
44-55-val fold_list :
66- ('acc -> 'a -> ('acc, 'e) result) -> 'acc -> 'a list -> ('acc, 'e) result
···3232 which will generally fix this issue. *)
33333434open Odoc_utils
3535-open Or_error
3535+open ResultMonad
36363737type named_root = string * Fs.Directory.t
3838module Named_roots : sig
+1-1
src/odoc/sidebar.ml
···11-open Or_error
21open Odoc_utils
22+open ResultMonad
3344let compile_to_json ~output sidebar =
55 let json = Odoc_html.Sidebar.to_json sidebar in
···11+type msg = [ `Msg of string ]
22+13(** The [result] type and a bind operator. This module is meant to be opened. *)
24module ResultMonad = struct
35 let map_error f = function Ok _ as ok -> ok | Error e -> Error (f e)