Update eff for OCaml 5 compatibility#91
Conversation
Need multicont now
The `effect` keyword is now reserved in OCaml 5, so rename the type alias and associated variables across the codebase.
|
@matijapretnar fixed the github actions (I forgot to bump the OCaml version). |
matijapretnar
left a comment
There was a problem hiding this comment.
Great, thank you for all the hard work @bodzioney! Perhaps we can also rename the multicore-ocaml backend (folder & command line option) to something else, like ocaml-handlers.
| let sequence sep pp vs ppf = | ||
| let i = String.length sep - 1 in | ||
| let space = sep.[i] = ' ' in | ||
| let space = i >= 0 && sep.[i] = ' ' in |
There was a problem hiding this comment.
Does the case i < 0 ever occur?
There was a problem hiding this comment.
I added it due to some test I had, but now I can't seem to reproduce it. The tests pass though so probably fine.
| Print.warning | ||
| "[#check] commands are ignored when compiling to Multicore OCaml." | ||
|
|
||
| and print_term_parens t ppf = |
There was a problem hiding this comment.
I suppose it does not matter because this output is not meant to be read by humans, but a nicer way to parenthesise on-demand can be achieved throught the Print.print funtion. See e.g.
Line 281 in f4d3dcd
Replace Obj.clone_continuation with Multicont.Deep.clone_continuation, update effect declarations to use `type _ Effect.t +=` syntax, and use comma-separated effect handler patterns.
Bump ocamlformat version from 0.25.1 to 0.29.0 in .ocamlformat and dune-project, and reformat all source and test files.
Not needed for compilation
|
Thank you very much @bodzioney!!! |
effecttype toeffthroughout the codebase, sinceeffectis now a reservedkeyword in OCaml 5
Obj.clone_continuationwithMulticont.Deep.clone_continuationand updateeffect handler syntax to OCaml 5 (
type _ Effect.t +=, comma-separated patterns)bounds check for empty separator