DEV Community

Jesse Warden
Jesse Warden

Posted on

Link: OCAML 5 is Out + Effects Tutorial

OCAML 5 was released, and one of the features many on Twitter were happy about was effect handlers. I don't have much experience in Haskell, but one of the cool features it offers is you choose if something is an Error/Exception and the program should stop, or you should keep going.

Typically, if it's your code, that's no problem. However, if it's in a 3rd party library, or a module you didn't write, you have no choice to just "handle the error". Unclear how this doesn't leak implementation details, but I'm super n00b at Effect handlers (a la Unison). Really cool to see it be used as a primitive to create async/await, streams, and Go-lang-like imperative style shared concurrency with all the type guarantee's OCAML gives you. I wonder when ReScript will enhance async/await to handle Effects (or maybe you already can).

Effects Tutorial:

OCAML 5 Announcement:

Top comments (0)