February 14, 2026
Side effects? Only in the comments
Fun with Algebraic Effects – From Toy Examples to Hardcaml Simulations
Jane Street swaps old toolkit for new magic—commenters bring the popcorn
TLDR: Jane Street rewrote a simulation library to use OCaml’s new “algebraic effects,” aiming for simpler, clearer code than the old monad style. Comments split between cheers for readability, cautions not to bury monads, and resource drops—making this a teachable fight over clarity, control, and modern OCaml moves.
A Jane Street engineer just swapped a hardware-simulation helper from the old “monads” style to shiny new “algebraic effects,” a feature in OCaml 5. Translation: fewer hoops to jump through, more readable code, and a claim that the new way is simply more elegant. There’s even a rename underway—Oxcaml_effect is becoming Handled_effect—and yes, the peanut gallery noticed. The post argues that what monads do, effects can do more cleanly, especially for simulations that need to pause and resume.
Cue the comments. The thread split into three moods: the “finally, less boilerplate!” crowd; the “don’t toss monads, they’re battle-tested” skeptics; and the pragmatic middle who say “use what fits.” One reader dropped a serious homework link to a book chapter on effects vs monads and name-dropped a model-checking tool for extra cred, turning the discussion from hype to homework. Meanwhile, the meme machine fired up: folks joking that effects are “monads without the ceremony,” others teasing that renaming libraries is the real hard problem. Underneath the jokes, the core fight is about clarity vs control—do you want code that reads like normal flow, or code that makes every step explicit? Either way, OCaml’s new trick just stole the spotlight, and the devs brought receipts with Handled_effect and links to deep dives like this book.
Key Points
- •Hardcaml_step_testbench was ported from monads to algebraic effects in OCaml 5.
- •The author argues that most monadic patterns can be expressed more elegantly with algebraic effects.
- •Algebraic effects were introduced in OCaml 5 to support concurrency and thread-level parallelism.
- •The Handled_effect library (currently named Oxcaml_effect) is used to work with algebraic effects.
- •An example using Async’s Deferred.t illustrates how monadic code can hinder readability compared to effects.