Skip to content

Update eff for OCaml 5 compatibility#91

Merged
matijapretnar merged 10 commits into
matijapretnar:masterfrom
bodzioney:master
Apr 2, 2026
Merged

Update eff for OCaml 5 compatibility#91
matijapretnar merged 10 commits into
matijapretnar:masterfrom
bodzioney:master

Conversation

@bodzioney
Copy link
Copy Markdown
Contributor

  • Rename effect type to eff throughout the codebase, since effect is now a reserved
    keyword in OCaml 5
  • Replace Obj.clone_continuation with Multicont.Deep.clone_continuation and update
    effect handler syntax to OCaml 5 (type _ Effect.t +=, comma-separated patterns)
  • Fix print output formatting: parenthesization for tuple elements and cons heads,
    bounds check for empty separator
  • Bump ocamlformat from 0.25.1 to 0.29.0 and reformat all source and test files

The `effect` keyword is now reserved in OCaml 5, so rename the type
alias and associated variables across the codebase.
@bodzioney
Copy link
Copy Markdown
Contributor Author

@matijapretnar fixed the github actions (I forgot to bump the OCaml version).

Copy link
Copy Markdown
Owner

@matijapretnar matijapretnar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread dune-project Outdated
Comment thread eff.opam Outdated
Comment thread .envrc
Comment thread src/00-utils/print.ml Outdated
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
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the case i < 0 ever occur?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 =
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

let rec print_expression ?max_level e ppf =

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment thread .github/workflows/gh-pages.yml Outdated
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
@matijapretnar matijapretnar merged commit 503da71 into matijapretnar:master Apr 2, 2026
1 check passed
@matijapretnar
Copy link
Copy Markdown
Owner

Thank you very much @bodzioney!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants