3 ms·
Out of curiosity since I'm not that familiar with OCaml: How would you make this extensible? It seems that adding new functions besides add and mult would req
by Garlef 4y ago
Out of curiosity since I'm not that familiar with OCaml:
How would you make this extensible?
It seems that adding new functions besides add and mult would require modifications to `run`, right?
- WastingMyTime89 4y agoAdd and Mult are added as extension of the type Effect.t and run installs the effect handler. To add more operations you would have to extend Effect.t again then setup an handler somewhere. The current effects syntax is very rough. It’s considered an experimental feature by the compiler team. Currently effects handlers are exposed to users as a thin wrapper on top of their implementations in the runtime. A better syntax will come but the Ocaml dev team wants to take the time necessary to get it right.