Fun with Algebraic Effects - from Toy Examples to Hardcaml Simulations

I recently ported the Hardcaml_step_testbench library, one of the libraries that we use at Jane Street for Hardcaml simulations, from using monads to using algebraic effects, a new OCaml 5 feature. This blog post walks through what algebraic effects are, why you should consider using them in lieu of monads, and how to actually work with them using theHandled_effect library. One thing I’ve come to believe is that most of what can be done with monads can be done with algebraic effects in a much more elegant way.

添加评论
点赞收藏
点踩分享查看原文
评论
?
参与讨论