ocaml
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

formatting

+54 -49
+3 -9
lib/compiler/Forest.ml
··· 24 24 25 25 type env = (module Forest_graphs.S) 26 26 27 - let legacy_query_engine 28 - : env -> (module Legacy_query_engine.S) 29 - = fun env -> 27 + let legacy_query_engine (env : env) : (module Legacy_query_engine.S) = 30 28 let module Graphs = (val env) in 31 29 (module Legacy_query_engine.Make(Graphs)) 32 30 ··· 37 35 38 36 (* let () = execute_datalog_script Builtin_relation.axioms *) 39 37 40 - let run_datalog_query 41 - : env -> (string, Vertex.t) Dx.query -> Vertex_set.t 42 - = fun graphs q -> 38 + let run_datalog_query (graphs : env) (q : (string, Vertex.t) Dx.query) : Vertex_set.t = 43 39 let () = execute_datalog_script graphs Builtin_relation.axioms in 44 40 let module Graphs = (val graphs) in 45 41 Datalog_eval.run_query Graphs.dl_db q ··· 162 158 None 163 159 | Some (T.Article article) -> Some article 164 160 165 - let plant_resource 166 - : resource -> (module Forest_graphs.S) -> resource t -> unit 167 - = fun resource graphs resources -> 161 + let plant_resource (resource : resource) (graphs : (module Forest_graphs.S)) (resources : resource t) : unit = 168 162 let module Graphs = (val graphs) in 169 163 analyse_resource graphs resource; 170 164 let@ iri = Option.iter @~ iri_for_resource resource in
+13 -4
lib/compiler/Forest.mli
··· 26 26 - When encountering a {{!Forester_core.Types.Datalog_script}[Datalog_script script]}, it runs the script and records the results in {{!Forester_core.Forest_graphs.S}[graphs]}. 27 27 *) 28 28 29 - val iri_for_resource : 'a T.resource -> Forester_core__.Base.iri option 29 + val iri_for_resource : 30 + 'a T.resource -> 31 + iri option 30 32 31 - val get_article : key -> T.content T.resource t -> T.content T.article option 33 + val get_article : 34 + key -> 35 + T.content T.resource t -> 36 + T.content T.article option 32 37 33 38 val run_datalog_query : 34 - (module Forest_graphs.S) -> (string, Forester_core.Vertex.t) Dx.query -> Forester_core.Vertex_set.t 39 + (module Forest_graphs.S) -> 40 + (string, Forester_core.Vertex.t) Dx.query -> 41 + Forester_core.Vertex_set.t 35 42 36 43 val plant_resource : 37 44 T.content T.resource -> ··· 47 54 T.content 48 55 49 56 val get_content_of_transclusion : 50 - T.content T.transclusion -> T.content T.resource t -> T.content option 57 + T.content T.transclusion -> 58 + T.content T.resource t -> 59 + T.content option 51 60 52 61 val get_title_or_content_of_vertex : 53 62 ?not_found: (key -> T.content option) ->
+8 -6
lib/core/Reporter.mli
··· 28 28 | IO_error 29 29 | Log 30 30 val pp : 31 - Ppx_deriving_runtime.Format.formatter -> t -> Ppx_deriving_runtime.unit 31 + Ppx_deriving_runtime.Format.formatter -> 32 + t -> 33 + Ppx_deriving_runtime.unit 32 34 val show : t -> Ppx_deriving_runtime.string 33 35 val default_severity : t -> Asai.Diagnostic.severity 34 36 val short_code : t -> string ··· 44 46 val silence : (unit -> 'a) -> 'a 45 47 val test_run : (unit -> 'a) -> 'a 46 48 val lsp_run : 47 - ?init_loc: Asai__.Range.t -> 48 - ?init_backtrace: Asai__.Diagnostic.backtrace -> 49 - ('a -> Message.t Asai__.Diagnostic.t list -> unit) -> 49 + ?init_loc: Asai.Range.t -> 50 + ?init_backtrace: Asai.Diagnostic.backtrace -> 51 + ('a -> Message.t Asai.Diagnostic.t list -> unit) -> 50 52 'a -> 51 53 (unit -> unit) -> 52 54 unit 53 55 val ignore : 54 - ?init_loc: Asai__.Range.t -> 55 - ?init_backtrace: Asai__.Diagnostic.backtrace -> 56 + ?init_loc: Asai.Range.t -> 57 + ?init_backtrace: Asai.Diagnostic.backtrace -> 56 58 (unit -> 'a) -> 57 59 'a
+30 -30
lib/frontend/Legacy_xml_client.ml
··· 187 187 (* match Hashtbl.find_opt frontmatter_cache frontmatter with *) 188 188 (* | Some cached -> cached *) 189 189 (* | None -> *) 190 - let config = State.config forest in 191 - let result = 192 - X.frontmatter 193 - [] 194 - [ 195 - render_attributions forest frontmatter.iri frontmatter.attributions; 196 - render_dates forest frontmatter.dates; 197 - X.conditional forest.dev (X.optional (X.source_path [] "%s") frontmatter.source_path); 198 - X.optional (fun iri -> X.addr [] "%s" @@ iri_to_string ~config iri) frontmatter.iri; 199 - X.optional (X.route [] "%s") @@ Option.map (route forest) frontmatter.iri; 200 - begin 201 - let title = get_expanded_title frontmatter forest.resources in 202 - X.title [X.text_ "%s" @@ Plain_text_client.string_of_content ~forest: forest.resources ~router: (route forest) title] @@ 203 - render_content forest title 204 - end; 205 - begin 206 - match frontmatter.taxon with 207 - | None -> X.null [] 208 - | Some taxon -> 209 - X.taxon [] @@ render_content forest (T.apply_modifier_to_content T.Sentence_case taxon) 210 - end; 211 - X.null (List.map (render_meta forest) frontmatter.metas) 212 - ] 213 - in 214 - (* Hashtbl.add frontmatter_cache frontmatter result; *) 215 - result 190 + let config = State.config forest in 191 + let result = 192 + X.frontmatter 193 + [] 194 + [ 195 + render_attributions forest frontmatter.iri frontmatter.attributions; 196 + render_dates forest frontmatter.dates; 197 + X.conditional forest.dev (X.optional (X.source_path [] "%s") frontmatter.source_path); 198 + X.optional (fun iri -> X.addr [] "%s" @@ iri_to_string ~config iri) frontmatter.iri; 199 + X.optional (X.route [] "%s") @@ Option.map (route forest) frontmatter.iri; 200 + begin 201 + let title = get_expanded_title frontmatter forest.resources in 202 + X.title [X.text_ "%s" @@ Plain_text_client.string_of_content ~forest: forest.resources ~router: (route forest) title] @@ 203 + render_content forest title 204 + end; 205 + begin 206 + match frontmatter.taxon with 207 + | None -> X.null [] 208 + | Some taxon -> 209 + X.taxon [] @@ render_content forest (T.apply_modifier_to_content T.Sentence_case taxon) 210 + end; 211 + X.null (List.map (render_meta forest) frontmatter.metas) 212 + ] 213 + in 214 + (* Hashtbl.add frontmatter_cache frontmatter result; *) 215 + result 216 216 217 217 and render_meta forest (key, body) = 218 218 X.meta [X.name "%s" key] @@ ··· 397 397 in 398 398 let all_attributions = 399 399 attributions @ 400 - let@ attribution = List.filter_map @~ indirect_attributions in 401 - if List.exists (fun (existing : _ T.attribution) -> Vertex.equal attribution.vertex existing.vertex) attributions then None 402 - else 403 - Some attribution 400 + let@ attribution = List.filter_map @~ indirect_attributions in 401 + if List.exists (fun (existing : _ T.attribution) -> Vertex.equal attribution.vertex existing.vertex) attributions then None 402 + else 403 + Some attribution 404 404 in 405 405 X.authors [] @@ List.map (render_attribution forest) all_attributions 406 406 in