Skip to content

Commit 5cb418b

Browse files
committed
4.02 compat: Prefix Result and remove new syntaxes
1 parent 441ad82 commit 5cb418b

File tree

8 files changed

+13
-14
lines changed

8 files changed

+13
-14
lines changed

src/html/config.mli

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
type t
44

55
val v :
6-
?search_result:bool
7-
(** Indicates whether this is a summary for a search result.
8-
In that case, the links will be printed as regular text. *) ->
6+
?search_result:bool ->
97
?theme_uri:Types.uri ->
108
?support_uri:Types.uri ->
119
?search_uris:Types.file_uri list ->
@@ -16,6 +14,8 @@ val v :
1614
as_json:bool ->
1715
unit ->
1816
t
17+
(** [search_result] indicates whether this is a summary for a search result. In
18+
that case, the links will be printed as regular text. *)
1919

2020
val theme_uri : t -> Types.uri
2121

src/odoc/bin/main.ml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ module Indexing = struct
405405
let output = output_file ~dst in
406406
match (inputs_in_file, inputs) with
407407
| [], [] ->
408-
Error
408+
Result.Error
409409
(`Msg
410410
"At least one of --file-list or an .odocl file must be passed to \
411411
odoc compile-index")
@@ -762,8 +762,7 @@ module Odoc_html_args = struct
762762
else Relative (conv_rel_file str))
763763
in
764764
let printer ppf = function
765-
| Odoc_html.Types.((Absolute uri : file_uri)) ->
766-
Format.pp_print_string ppf uri
765+
| Odoc_html.Types.Absolute uri -> Format.pp_print_string ppf uri
767766
| Odoc_html.Types.Relative _uri -> Format.pp_print_string ppf ""
768767
in
769768
(parser, printer)

src/search/html.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ let url id =
1414
~indent:false ~flat:false ~open_details:false ~as_json:false ()
1515
in
1616
let url = Odoc_html.Link.href ~config ~resolve:(Base "") url in
17-
Ok url
17+
Result.Ok url
1818
| Error _ as e -> e
1919

2020
let map_option f = function Some x -> Some (f x) | None -> None

src/search/html.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ val of_entry : Entry.t -> html list
66

77
val url :
88
Odoc_model.Paths.Identifier.Any.t ->
9-
(string, Odoc_document.Url.Error.t) result
9+
(string, Odoc_document.Url.Error.t) Result.result
1010

1111
(** The below is intended for search engine that do not use the Json output but
1212
Odoc as a library. Most search engine will use their own representation

src/search/json_index/json_display.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ open Odoc_search
22

33
let of_entry { Entry.id; doc = _; kind = _ } h =
44
match Html.url id with
5-
| Ok url ->
5+
| Result.Ok url ->
66
let html =
77
h
88
|> List.map (fun html ->
99
Format.asprintf "%a" (Tyxml.Html.pp_elt ()) html)
1010
|> String.concat ""
1111
in
12-
Ok (`Object [ ("url", `String url); ("html", `String html) ])
12+
Result.Ok (`Object [ ("url", `String url); ("html", `String html) ])
1313
| Error _ as e -> e

src/search/json_index/json_display.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ open Odoc_search
33
val of_entry :
44
Entry.t ->
55
Html.html list ->
6-
(Odoc_html.Json.json, Odoc_document.Url.Error.t) result
6+
(Odoc_html.Json.json, Odoc_document.Url.Error.t) Result.result

src/search/json_index/json_search.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,8 @@ let of_entry ({ Entry.id; doc; kind } as entry) html =
168168
]
169169
in
170170
match Json_display.of_entry entry html with
171-
| Ok display ->
172-
Ok
171+
| Result.Ok display ->
172+
Result.Ok
173173
(`Object
174174
[ ("id", j_id); ("doc", doc); ("kind", kind); ("display", display) ])
175175
| Error _ as e -> e

src/xref2/tools.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1254,7 +1254,7 @@ and resolve_type :
12541254
and resolve_datatype :
12551255
Env.t -> add_canonical:bool -> Cpath.datatype -> resolve_datatype_result =
12561256
fun env ~add_canonical p ->
1257-
let ( >>> ) = Option.bind in
1257+
let ( >>> ) = OptionMonad.bind in
12581258
let rec id_datatype_of_type (id : Odoc_model.Comment.Identifier.Id.path_type)
12591259
: Odoc_model.Comment.Identifier.Id.path_datatype option =
12601260
match id with

0 commit comments

Comments
 (0)