ocaml
0
fork

Configure Feed

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

Add missing SPDX license header, add REUSE.toml to test directory

authored by

Kento Okura and committed by
Jon Sterling
ff539404 6506ea23

+43 -388
-65
NOTES.md
··· 1 - I have a compiler that features multiple compilation phases. For examples sake, 2 - consider the following simplified pipeline: 3 - 4 - ```ocaml 5 - module M = Map.Make(String) 6 - 7 - type state = { 8 - phase1: string M.t; 9 - phase2: int M.t; 10 - phase3: string M.t; 11 - } 12 - 13 - let step1 = M.map String.length 14 - let step2 = M.map Int.to_string 15 - 16 - let init source = 17 - { 18 - phase1 = source; 19 - phase2 = M.empty; 20 - phase3 = M.empty 21 - } 22 - 23 - let run_phase1 24 - : state -> state 25 - = fun state -> 26 - { 27 - state with 28 - phase2 = step1 state.phase1 29 - } 30 - 31 - let run_phase2 32 - : state -> state 33 - = fun state -> 34 - { 35 - state with 36 - phase3 = step2 state.phase2 37 - } 38 - ``` 39 - 40 - *Why do you need a state type? Can't we just compose the functions step1 and 41 - step2?* 42 - 43 - The answer is yes, if we only want to consider batch compilation. The 44 - state type arose from the development of a language server that needs access to 45 - all compilation phases. I also want to cleverly update the state upon granular 46 - changes (for example, when a source changes only recompile the stuff that 47 - depends on it, although the example is too simplified to capture that) 48 - 49 - This gets to the type of thing I would like to capture. 50 - 51 - *Can I use GADTs to prevent phase2 from being run before phase1 completed?* 52 - 53 - I am imagining that `state` could be a GADT such that the types of `run_phase*` 54 - reflect that a phase transition is happening. I have had success with GADTs in 55 - the past and it feels to me like this is a potential usecase for them, but I 56 - can't seemt to actually write down what I want. 57 - 58 - I realize that I might be trying to be too clever. I could just design an 59 - interface that ensures that everything is being used correctly, but using GADTs 60 - is more slick. 61 - 62 - Any pointers, suggestions or alternative approaches are appreciated! 63 - 64 - Related: 65 - - https://raphael-proust.gitlab.io/code/gadt-tips-and-tricks.html
+7 -1
docs/dune
··· 1 - (documentation) 1 + ;;; SPDX-FileCopyrightText: 2024 The Forester Project Contributors 2 + ;;; 3 + ;;; SPDX-License-Identifier: GPL-3.0-or-later 4 + 5 + (documentation 6 + (package forester) 7 + (mld_files index test developing))
-1
docs/test.mld
··· 1 - {0 Test}
-4
dune
··· 5 5 (env 6 6 (static 7 7 (link_flags (-ccopt -static)))) 8 - 9 - (documentation 10 - (package forester) 11 - (mld_files index))
-35
index.mld
··· 1 - {0 Forester developer docs} 2 - 3 - Forester is a compiled markup language for authoring scientific hypertext. This documentation is intended to give an overview of forester internals for people interested in contributing to the project. 4 - 5 - {1 Questions} 6 - 7 - If you have questions, feel free to write an email to [https://lists.sr.ht/~jonsterling/forester-discuss]. Please employ {{: https://useplaintext.email/#etiquette} plaintext email etiquette}, including line wrapping. 8 - 9 - {1 Getting started} 10 - 11 - Forester is implementend in the {{: https://ocaml.org/}OCaml programming language}, so you will need to have the OCaml toolchain installed. You can find instructions {{: https://ocaml.org/install#linux_mac_bsd}here}. Alternatively, you can get access to the toolchain using the {{: https://nixos.org/}Nix package manager}. 12 - 13 - {2 Building the project} 14 - 15 - [dune build] 16 - 17 - {2 Testing} 18 - 19 - [dune runtest] 20 - 21 - {2 Sending a patch} 22 - 23 - Once your changes are ready, follow {{: https://lists.sr.ht/~jonsterling/forester-devel}these instructions} to submit them for review. 24 - 25 - {1 Codebase overview} 26 - 27 - The code is organized into several libraries: 28 - 29 - {!modules: 30 - Forester_core 31 - Forester_compiler 32 - Forester_frontend 33 - Forester_lsp} 34 - 35 - {{!test} Test}
+6
lib/compiler/Code.mli
··· 1 + (* 2 + * SPDX-FileCopyrightText: 2024 The Forester Project Contributors 3 + * 4 + * SPDX-License-Identifier: GPL-3.0-or-later 5 + *) 6 + 1 7 type node = 2 8 Text of string 3 9 | Verbatim of string
+6
lib/compiler/Export_for_test.ml
··· 1 + (* 2 + * SPDX-FileCopyrightText: 2024 The Forester Project Contributors 3 + * 4 + * SPDX-License-Identifier: GPL-3.0-or-later 5 + *) 6 + 1 7 module LaTeX_template = LaTeX_template
+6
lib/prelude/Eio_util.mli
··· 1 + (* 2 + * SPDX-FileCopyrightText: 2024 The Forester Project Contributors 3 + * 4 + * SPDX-License-Identifier: GPL-3.0-or-later 5 + *) 6 + 1 7 open Eio 2 8 3 9 (* val ( / ) : ([> Fs.dir_ty ] as 'a) Path.t -> string -> 'a Path.t *)
-282
test/Cram.t
··· 1 - Run build: 2 - 3 - $ cd forest 4 - $ forester build 5 - ○ Parse trees... 6 - 7 - ○ Expand, evaluate and analyse forest... 8 - 9 - 10 - $ cat output/* 11 - {"hello":{"title":"Hello","taxon":null,"tags":[],"route":"hello.xml","metas":{}},"nested":{"title":"I am nested","taxon":null,"tags":[],"route":"nested.xml","metas":{}},"lorem":{"title":"Forest://lsp-test/lorem","taxon":null,"tags":[],"route":"lorem.xml","metas":{}},"person":{"title":"Author Testington","taxon":"Person","tags":[],"route":"person.xml","metas":{}}}<?xml version="1.0" encoding="UTF-8"?> 12 - <?xml-stylesheet type="text/xsl" href="default.xsl"?> 13 - <fr:tree xmlns:fr="http://www.jonmsterling.com/jms-005P.xml" root="false"> 14 - <fr:frontmatter> 15 - <fr:authors> 16 - <fr:author> 17 - <fr:link href="person.xml" title="Author Testington" addr="person" type="local">Author Testington</fr:link> 18 - </fr:author> 19 - </fr:authors> 20 - <fr:anchor>401</fr:anchor> 21 - <fr:addr type="user">hello</fr:addr> 22 - <fr:route>hello.xml</fr:route> 23 - <fr:title text="Hello">Hello</fr:title> 24 - </fr:frontmatter> 25 - <fr:mainmatter> 26 - <fr:tree show-metadata="false"> 27 - <fr:frontmatter> 28 - <fr:authors /> 29 - <fr:anchor>400</fr:anchor> 30 - <fr:addr type="user">lorem</fr:addr> 31 - <fr:route>lorem.xml</fr:route> 32 - <fr:title text="" /> 33 - </fr:frontmatter> 34 - <fr:mainmatter> 35 - <fr:p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla imperdiet tempus mauris vel suscipit. Vestibulum tincidunt turpis et risus vulputate volutpat. Interdum et malesuada fames ac ante ipsum primis in faucibus. Quisque sit amet nisl et diam eleifend facilisis. Aliquam porta, turpis in volutpat congue, mi ligula dictum nunc, ac mollis erat ex eget nunc. Vestibulum at posuere quam. Proin facilisis porta erat, et feugiat libero egestas at. Morbi rhoncus fringilla dolor, sit amet egestas lectus dictum vel. Curabitur arcu lectus, feugiat a nibh nec, scelerisque porta augue. Mauris interdum magna odio, sed efficitur turpis fermentum at. Nunc imperdiet metus sit amet nulla ornare condimentum. Cras id auctor sem.</fr:p> 36 - </fr:mainmatter> 37 - </fr:tree> 38 - </fr:mainmatter> 39 - <fr:backmatter> 40 - <fr:tree show-metadata="false" hidden-when-empty="true"> 41 - <fr:frontmatter> 42 - <fr:anchor>395</fr:anchor> 43 - <fr:title text="References">References</fr:title> 44 - </fr:frontmatter> 45 - <fr:mainmatter /> 46 - </fr:tree> 47 - <fr:tree show-metadata="false" hidden-when-empty="true"> 48 - <fr:frontmatter> 49 - <fr:anchor>396</fr:anchor> 50 - <fr:title text="Context">Context</fr:title> 51 - </fr:frontmatter> 52 - <fr:mainmatter /> 53 - </fr:tree> 54 - <fr:tree show-metadata="false" hidden-when-empty="true"> 55 - <fr:frontmatter> 56 - <fr:anchor>397</fr:anchor> 57 - <fr:title text="Backlinks">Backlinks</fr:title> 58 - </fr:frontmatter> 59 - <fr:mainmatter /> 60 - </fr:tree> 61 - <fr:tree show-metadata="false" hidden-when-empty="true"> 62 - <fr:frontmatter> 63 - <fr:anchor>398</fr:anchor> 64 - <fr:title text="Related">Related</fr:title> 65 - </fr:frontmatter> 66 - <fr:mainmatter /> 67 - </fr:tree> 68 - <fr:tree show-metadata="false" hidden-when-empty="true"> 69 - <fr:frontmatter> 70 - <fr:anchor>399</fr:anchor> 71 - <fr:title text="Contributions">Contributions</fr:title> 72 - </fr:frontmatter> 73 - <fr:mainmatter /> 74 - </fr:tree> 75 - </fr:backmatter> 76 - </fr:tree> 77 - <?xml version="1.0" encoding="UTF-8"?> 78 - <?xml-stylesheet type="text/xsl" href="default.xsl"?> 79 - <fr:tree xmlns:fr="http://www.jonmsterling.com/jms-005P.xml" root="false"> 80 - <fr:frontmatter> 81 - <fr:authors /> 82 - <fr:anchor>414</fr:anchor> 83 - <fr:addr type="user">lorem</fr:addr> 84 - <fr:route>lorem.xml</fr:route> 85 - <fr:title text="" /> 86 - </fr:frontmatter> 87 - <fr:mainmatter> 88 - <fr:p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla imperdiet tempus mauris vel suscipit. Vestibulum tincidunt turpis et risus vulputate volutpat. Interdum et malesuada fames ac ante ipsum primis in faucibus. Quisque sit amet nisl et diam eleifend facilisis. Aliquam porta, turpis in volutpat congue, mi ligula dictum nunc, ac mollis erat ex eget nunc. Vestibulum at posuere quam. Proin facilisis porta erat, et feugiat libero egestas at. Morbi rhoncus fringilla dolor, sit amet egestas lectus dictum vel. Curabitur arcu lectus, feugiat a nibh nec, scelerisque porta augue. Mauris interdum magna odio, sed efficitur turpis fermentum at. Nunc imperdiet metus sit amet nulla ornare condimentum. Cras id auctor sem.</fr:p> 89 - </fr:mainmatter> 90 - <fr:backmatter> 91 - <fr:tree show-metadata="false" hidden-when-empty="true"> 92 - <fr:frontmatter> 93 - <fr:anchor>408</fr:anchor> 94 - <fr:title text="References">References</fr:title> 95 - </fr:frontmatter> 96 - <fr:mainmatter /> 97 - </fr:tree> 98 - <fr:tree show-metadata="false" hidden-when-empty="true"> 99 - <fr:frontmatter> 100 - <fr:anchor>410</fr:anchor> 101 - <fr:title text="Context">Context</fr:title> 102 - </fr:frontmatter> 103 - <fr:mainmatter> 104 - <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false"> 105 - <fr:frontmatter> 106 - <fr:authors> 107 - <fr:author> 108 - <fr:link href="person.xml" title="Author Testington" addr="person" type="local">Author Testington</fr:link> 109 - </fr:author> 110 - </fr:authors> 111 - <fr:anchor>409</fr:anchor> 112 - <fr:addr type="user">hello</fr:addr> 113 - <fr:route>hello.xml</fr:route> 114 - <fr:title text="Hello">Hello</fr:title> 115 - </fr:frontmatter> 116 - <fr:mainmatter> 117 - <fr:tree show-metadata="false"> 118 - <fr:frontmatter> 119 - <fr:authors /> 120 - <fr:anchor>400</fr:anchor> 121 - <fr:addr type="user">lorem</fr:addr> 122 - <fr:route>lorem.xml</fr:route> 123 - <fr:title text="" /> 124 - </fr:frontmatter> 125 - <fr:mainmatter> 126 - <fr:p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla imperdiet tempus mauris vel suscipit. Vestibulum tincidunt turpis et risus vulputate volutpat. Interdum et malesuada fames ac ante ipsum primis in faucibus. Quisque sit amet nisl et diam eleifend facilisis. Aliquam porta, turpis in volutpat congue, mi ligula dictum nunc, ac mollis erat ex eget nunc. Vestibulum at posuere quam. Proin facilisis porta erat, et feugiat libero egestas at. Morbi rhoncus fringilla dolor, sit amet egestas lectus dictum vel. Curabitur arcu lectus, feugiat a nibh nec, scelerisque porta augue. Mauris interdum magna odio, sed efficitur turpis fermentum at. Nunc imperdiet metus sit amet nulla ornare condimentum. Cras id auctor sem.</fr:p> 127 - </fr:mainmatter> 128 - </fr:tree> 129 - </fr:mainmatter> 130 - </fr:tree> 131 - </fr:mainmatter> 132 - </fr:tree> 133 - <fr:tree show-metadata="false" hidden-when-empty="true"> 134 - <fr:frontmatter> 135 - <fr:anchor>411</fr:anchor> 136 - <fr:title text="Backlinks">Backlinks</fr:title> 137 - </fr:frontmatter> 138 - <fr:mainmatter /> 139 - </fr:tree> 140 - <fr:tree show-metadata="false" hidden-when-empty="true"> 141 - <fr:frontmatter> 142 - <fr:anchor>412</fr:anchor> 143 - <fr:title text="Related">Related</fr:title> 144 - </fr:frontmatter> 145 - <fr:mainmatter /> 146 - </fr:tree> 147 - <fr:tree show-metadata="false" hidden-when-empty="true"> 148 - <fr:frontmatter> 149 - <fr:anchor>413</fr:anchor> 150 - <fr:title text="Contributions">Contributions</fr:title> 151 - </fr:frontmatter> 152 - <fr:mainmatter /> 153 - </fr:tree> 154 - </fr:backmatter> 155 - </fr:tree> 156 - <?xml version="1.0" encoding="UTF-8"?> 157 - <?xml-stylesheet type="text/xsl" href="default.xsl"?> 158 - <fr:tree xmlns:fr="http://www.jonmsterling.com/jms-005P.xml" root="false"> 159 - <fr:frontmatter> 160 - <fr:authors /> 161 - <fr:anchor>407</fr:anchor> 162 - <fr:addr type="user">nested</fr:addr> 163 - <fr:route>nested.xml</fr:route> 164 - <fr:title text="I am nested">I am nested</fr:title> 165 - </fr:frontmatter> 166 - <fr:mainmatter /> 167 - <fr:backmatter> 168 - <fr:tree show-metadata="false" hidden-when-empty="true"> 169 - <fr:frontmatter> 170 - <fr:anchor>402</fr:anchor> 171 - <fr:title text="References">References</fr:title> 172 - </fr:frontmatter> 173 - <fr:mainmatter /> 174 - </fr:tree> 175 - <fr:tree show-metadata="false" hidden-when-empty="true"> 176 - <fr:frontmatter> 177 - <fr:anchor>403</fr:anchor> 178 - <fr:title text="Context">Context</fr:title> 179 - </fr:frontmatter> 180 - <fr:mainmatter /> 181 - </fr:tree> 182 - <fr:tree show-metadata="false" hidden-when-empty="true"> 183 - <fr:frontmatter> 184 - <fr:anchor>404</fr:anchor> 185 - <fr:title text="Backlinks">Backlinks</fr:title> 186 - </fr:frontmatter> 187 - <fr:mainmatter /> 188 - </fr:tree> 189 - <fr:tree show-metadata="false" hidden-when-empty="true"> 190 - <fr:frontmatter> 191 - <fr:anchor>405</fr:anchor> 192 - <fr:title text="Related">Related</fr:title> 193 - </fr:frontmatter> 194 - <fr:mainmatter /> 195 - </fr:tree> 196 - <fr:tree show-metadata="false" hidden-when-empty="true"> 197 - <fr:frontmatter> 198 - <fr:anchor>406</fr:anchor> 199 - <fr:title text="Contributions">Contributions</fr:title> 200 - </fr:frontmatter> 201 - <fr:mainmatter /> 202 - </fr:tree> 203 - </fr:backmatter> 204 - </fr:tree> 205 - <?xml version="1.0" encoding="UTF-8"?> 206 - <?xml-stylesheet type="text/xsl" href="default.xsl"?> 207 - <fr:tree xmlns:fr="http://www.jonmsterling.com/jms-005P.xml" root="false"> 208 - <fr:frontmatter> 209 - <fr:authors /> 210 - <fr:anchor>421</fr:anchor> 211 - <fr:addr type="user">person</fr:addr> 212 - <fr:route>person.xml</fr:route> 213 - <fr:title text="Author Testington">Author Testington</fr:title> 214 - <fr:taxon>Person</fr:taxon> 215 - </fr:frontmatter> 216 - <fr:mainmatter /> 217 - <fr:backmatter> 218 - <fr:tree show-metadata="false" hidden-when-empty="true"> 219 - <fr:frontmatter> 220 - <fr:anchor>415</fr:anchor> 221 - <fr:title text="References">References</fr:title> 222 - </fr:frontmatter> 223 - <fr:mainmatter /> 224 - </fr:tree> 225 - <fr:tree show-metadata="false" hidden-when-empty="true"> 226 - <fr:frontmatter> 227 - <fr:anchor>416</fr:anchor> 228 - <fr:title text="Context">Context</fr:title> 229 - </fr:frontmatter> 230 - <fr:mainmatter /> 231 - </fr:tree> 232 - <fr:tree show-metadata="false" hidden-when-empty="true"> 233 - <fr:frontmatter> 234 - <fr:anchor>417</fr:anchor> 235 - <fr:title text="Backlinks">Backlinks</fr:title> 236 - </fr:frontmatter> 237 - <fr:mainmatter /> 238 - </fr:tree> 239 - <fr:tree show-metadata="false" hidden-when-empty="true"> 240 - <fr:frontmatter> 241 - <fr:anchor>418</fr:anchor> 242 - <fr:title text="Related">Related</fr:title> 243 - </fr:frontmatter> 244 - <fr:mainmatter /> 245 - </fr:tree> 246 - <fr:tree show-metadata="false" hidden-when-empty="true"> 247 - <fr:frontmatter> 248 - <fr:anchor>420</fr:anchor> 249 - <fr:title text="Contributions">Contributions</fr:title> 250 - </fr:frontmatter> 251 - <fr:mainmatter> 252 - <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false"> 253 - <fr:frontmatter> 254 - <fr:authors> 255 - <fr:author> 256 - <fr:link href="person.xml" title="Author Testington" addr="person" type="local">Author Testington</fr:link> 257 - </fr:author> 258 - </fr:authors> 259 - <fr:anchor>419</fr:anchor> 260 - <fr:addr type="user">hello</fr:addr> 261 - <fr:route>hello.xml</fr:route> 262 - <fr:title text="Hello">Hello</fr:title> 263 - </fr:frontmatter> 264 - <fr:mainmatter> 265 - <fr:tree show-metadata="false"> 266 - <fr:frontmatter> 267 - <fr:authors /> 268 - <fr:anchor>400</fr:anchor> 269 - <fr:addr type="user">lorem</fr:addr> 270 - <fr:route>lorem.xml</fr:route> 271 - <fr:title text="" /> 272 - </fr:frontmatter> 273 - <fr:mainmatter> 274 - <fr:p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla imperdiet tempus mauris vel suscipit. Vestibulum tincidunt turpis et risus vulputate volutpat. Interdum et malesuada fames ac ante ipsum primis in faucibus. Quisque sit amet nisl et diam eleifend facilisis. Aliquam porta, turpis in volutpat congue, mi ligula dictum nunc, ac mollis erat ex eget nunc. Vestibulum at posuere quam. Proin facilisis porta erat, et feugiat libero egestas at. Morbi rhoncus fringilla dolor, sit amet egestas lectus dictum vel. Curabitur arcu lectus, feugiat a nibh nec, scelerisque porta augue. Mauris interdum magna odio, sed efficitur turpis fermentum at. Nunc imperdiet metus sit amet nulla ornare condimentum. Cras id auctor sem.</fr:p> 275 - </fr:mainmatter> 276 - </fr:tree> 277 - </fr:mainmatter> 278 - </fr:tree> 279 - </fr:mainmatter> 280 - </fr:tree> 281 - </fr:backmatter> 282 - </fr:tree>
+8
test/REUSE.toml
··· 1 + version = 1 2 + 3 + [[annotations]] 4 + path = ["**"] 5 + precedence = "aggregate" 6 + SPDX-FileCopyrightText = "2024 The Forester Project Contributors" 7 + SPDX-License-Identifier = "GPL-3.0-or-later" 8 +
+5
test/Test_graph_database.ml
··· 1 + (* 2 + * SPDX-FileCopyrightText: 2024 The Forester Project Contributors 3 + * 4 + * SPDX-License-Identifier: GPL-3.0-or-later 5 + *)
+5
test/Test_json_manifest_client.ml
··· 1 + (* 2 + * SPDX-FileCopyrightText: 2024 The Forester Project Contributors 3 + * 4 + * SPDX-License-Identifier: GPL-3.0-or-later 5 + *)