this repo has no description

Compatibility: remove all redefinition of concat_map

Signed-off-by: Paul-Elliot <peada@free.fr>

authored by

Paul-Elliot and committed by jon.recoil.org e71e6377 199cdc3c

+16 -52
+4 -4
src/html/generator.ml
··· 83 83 let content = tokens l in 84 84 if content = [] then [] else [ Html.span content ] 85 85 | Tag (Some s, l) -> [ Html.span ~a:[ Html.a_class [ s ] ] (tokens l) ] 86 - and tokens t = Utils.list_concat_map t ~f:token in 86 + and tokens t = Odoc_utils.List.concat_map t ~f:token in 87 87 Utils.optional_elt Html.code ?a (tokens t) 88 88 89 89 and styled style ~emph_level = ··· 151 151 | Math s -> [ inline_math s ] 152 152 | Raw_markup r -> raw_markup r 153 153 in 154 - Utils.list_concat_map ~f:one l 154 + Odoc_utils.List.concat_map ~f:one l 155 155 156 156 and inline_nolink ?(emph_level = 0) (l : Inline.t) : 157 157 non_link_phrasing Html.elt list = ··· 173 173 | Math s -> [ inline_math s ] 174 174 | Raw_markup r -> raw_markup r 175 175 in 176 - Utils.list_concat_map ~f:one l 176 + Odoc_utils.List.concat_map ~f:one l 177 177 178 178 let heading ~config ~resolve (h : Heading.t) = 179 179 let a, anchor = ··· 244 244 mk_block ~extra_class Html.pre (source (inline ~config ~resolve) c) 245 245 | Math s -> mk_block Html.div [ block_math s ] 246 246 in 247 - Utils.list_concat_map l ~f:one 247 + Odoc_utils.List.concat_map l ~f:one 248 248 249 249 and mk_rows ~config ~resolve { align; data } = 250 250 let mk_row row =
+1 -1
src/html/html_page.ml
··· 86 86 let sep = [ space; Html.entity "#x00BB"; space ] in 87 87 let html = 88 88 (* Create breadcrumbs *) 89 - Utils.list_concat_map ?sep:(Some sep) 89 + Odoc_utils.List.concat_map ?sep:(Some sep) 90 90 ~f:(fun (breadcrumb : Types.breadcrumb) -> 91 91 [ 92 92 [
-8
src/html/utils.ml
··· 3 3 (* = Option.fold *) 4 4 let fold_option ~none ~some = function Some x -> some x | None -> none 5 5 6 - let rec list_concat_map ?sep ~f = function 7 - | [] -> [] 8 - | [ x ] -> f x 9 - | x :: xs -> ( 10 - let hd = f x in 11 - let tl = list_concat_map ?sep ~f xs in 12 - match sep with None -> hd @ tl | Some sep -> hd @ (sep :: tl)) 13 - 14 6 let optional_elt f ?a = function [] -> [] | l -> [ f ?a l ] 15 7 16 8 module Json = struct
+1 -1
src/latex/dune
··· 5 5 (backend landmarks --auto)) 6 6 (instrumentation 7 7 (backend bisect_ppx)) 8 - (libraries odoc_model odoc_document fmt fpath)) 8 + (libraries odoc_model odoc_document fmt fpath odoc_utils))
+2 -10
src/latex/generator.ml
··· 2 2 open Types 3 3 module Doctree = Odoc_document.Doctree 4 4 5 - let rec list_concat_map ?sep ~f = function 6 - | [] -> [] 7 - | [ x ] -> f x 8 - | x :: xs -> ( 9 - let hd = f x in 10 - let tl = list_concat_map ?sep ~f xs in 11 - match sep with None -> hd @ tl | Some sep -> hd @ (sep :: tl)) 12 - 13 5 module Link = struct 14 6 let rec flatten_path ppf (x : Odoc_document.Url.Path.t) = 15 7 match x.parent with ··· 228 220 | Elt i -> k i 229 221 | Tag (None, l) -> tokens l 230 222 | Tag (Some s, l) -> [ Tag (s, tokens l) ] 231 - and tokens t = list_concat_map t ~f:token in 223 + and tokens t = Odoc_utils.List.concat_map t ~f:token in 232 224 tokens t 233 225 234 226 let rec internalref ~verbatim ~in_source (t : InternalLink.t) = ··· 316 308 Break Paragraph; 317 309 ] 318 310 in 319 - list_concat_map l ~f:one 311 + Odoc_utils.List.concat_map l ~f:one 320 312 321 313 and table_block { Table.data; align } = 322 314 let data =
+1 -1
src/loader/dune
··· 22 22 (preprocess 23 23 (action 24 24 (run %{bin:cppo} -V OCAML:%{ocaml_version} %{input-file}))) 25 - (libraries odoc_model odoc-parser syntax_highlighter odoc_document)) 25 + (libraries odoc_model odoc-parser syntax_highlighter odoc_document odoc_utils))
+2 -10
src/loader/ident_env.cppo.ml
··· 163 163 #endif 164 164 165 165 166 - let concat_map f l = 167 - let rec aux f acc = function 168 - | [] -> List.rev acc 169 - | x :: l -> 170 - let xs = f x in 171 - aux f (List.rev_append xs acc) l 172 - in aux f [] l 173 - 174 166 let rec extract_signature_tree_items : bool -> Typedtree.signature_item list -> items list = fun hide_item items -> 175 167 let open Typedtree in 176 168 match items with ··· 179 171 #else 180 172 | { sig_desc = Tsig_type (_, decls); _} :: rest -> 181 173 #endif 182 - concat_map (fun decl -> 174 + Odoc_utils.List.concat_map ~f:(fun decl -> 183 175 if Btype.is_row_name (Ident.name decl.typ_id) 184 176 then [] 185 177 else ··· 315 307 #else 316 308 | { str_desc = Tstr_type (_, decls); _ } :: rest -> (* TODO: handle rec_flag *) 317 309 #endif 318 - concat_map (fun decl -> 310 + Odoc_utils.List.concat_map ~f:(fun decl -> 319 311 `Type (decl.typ_id, hide_item, Some decl.typ_loc) :: 320 312 (match decl.typ_kind with 321 313 Ttype_abstract -> []
+2 -2
src/search/dune
··· 1 1 (library 2 2 (name odoc_html_frontend) 3 3 (public_name odoc.search_html_frontend) 4 - (libraries tyxml) 4 + (libraries tyxml odoc_utils) 5 5 (modules odoc_html_frontend)) 6 6 7 7 (library 8 8 (name odoc_search) 9 9 (public_name odoc.search) 10 - (libraries odoc_html odoc_model odoc_html_frontend tyxml) 10 + (libraries odoc_html odoc_model odoc_html_frontend tyxml odoc_utils) 11 11 (modules :standard \ odoc_html_frontend))
+3 -11
src/search/entry.ml
··· 1 1 open Odoc_model.Lang 2 2 open Odoc_model.Paths 3 3 4 - let list_concat_map f l = 5 - let rec aux f acc = function 6 - | [] -> List.rev acc 7 - | x :: l -> 8 - let xs = f x in 9 - aux f (List.rev_append xs acc) l 10 - in 11 - aux f [] l 12 - 13 4 type type_decl_entry = { 14 5 canonical : Path.Type.t option; 15 6 equation : TypeDecl.Equation.t; ··· 125 116 entry ~id:field.id ~doc:field.doc ~kind 126 117 127 118 let rec entries_of_docs id (d : Odoc_model.Comment.docs) = 128 - list_concat_map (entries_of_doc id) d 119 + Odoc_utils.List.concat_map ~f:(entries_of_doc id) d 129 120 130 121 and entries_of_doc id d = 131 122 match d.value with 132 123 | `Paragraph _ -> [ entry ~id ~doc:[ d ] ~kind:(Doc Paragraph) ] 133 124 | `Tag _ -> [] 134 125 | `List (_, ds) -> 135 - list_concat_map (entries_of_docs id) (ds :> Odoc_model.Comment.docs list) 126 + Odoc_utils.List.concat_map ~f:(entries_of_docs id) 127 + (ds :> Odoc_model.Comment.docs list) 136 128 | `Heading (_, lbl, _) -> [ entry ~id:lbl ~doc:[ d ] ~kind:(Doc Heading) ] 137 129 | `Modules _ -> [] 138 130 | `Code_block (_, _, o) ->
-4
src/xref2/utils.ml
··· 42 42 let of_result = function Result.Ok x -> Right x | Error y -> Left y 43 43 end 44 44 45 - let rec concat_map acc f = function 46 - | hd :: tl -> concat_map (List.rev_append (f hd) acc) f tl 47 - | [] -> List.rev acc 48 - 49 45 let rec filter_map acc f = function 50 46 | hd :: tl -> 51 47 let acc = match f hd with Some x -> x :: acc | None -> acc in