New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update to OCaml 5.0 implementation of effects #7
Conversation
Still a few sections like the GDB one that could use some work, but this is good enough to release in my opinion
Two things I'm worried about:
|
Hi @tanelso2. Thanks for the work! It looks good to me overall.
That seems fine to me.
We've simplified the implementation of effect handlers and the gdb support. Hence, the changes are expected. |
Perhaps @Sudha247 may also have a look at this PR. |
An effect system for OCaml | ||
[is in development](https://www.youtube.com/watch?t=2035&v=z8SI7WBtlcA&feature=youtu.be). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is still true.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is aimed at being a tutorial for the initial release of effects, does it still make sense to say it is "in development"?
It seems out of place and doesn't flow well
## 2. Effectful Computations in a Pure Setting | ||
## 2. Shallow vs Deep Handlers | ||
|
||
The OCaml standard library provides two different modules for handling effects: `Effect.Deep` and `Effect.Shallow`. When a deep handler returns a continuation, the continuation also includes the handler. This means that, when the continuation is resumed, the effect handler is automatically re-installed, and will handle the effect(s) that the computation may perform in the future. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wish we hadn't named the module Effect.Shallow
as the handler therein are not shallow. Genuine shallow handlers are more expressive in a certain sense than the (sheep) handlers exposed by that module. I guess it is too late to make this change upstream @kayceesrk.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Naming things is hard. Would you call these Sheep
handlers rather than Shallow
handlers? In any case, it may be useful to create an issue on ocaml/ocaml with a justification for why Shallow
handlers may not be the most appropriate name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can someone link me something on the difference between shallow and sheep handlers? I had trouble finding any information on this with Google, not sure where I should be looking
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the work @tanelso2! I've left some comments below. Thanks for also updating from travis to GitHub Actions. Unrelated to this PR, we could maybe update it to run the code on a OCaml 5 pipeline.
GitHub Actions job passed: https://github.com/tanelso2/ocaml-effects-tutorial/actions/runs/3476866298. It doesn't show up on the PR, I think it will be activated if the PR is merged. The outstanding comments have been addressed. |
If there are no further outstanding comments, feel free to merge @Sudha247 |
Thanks again @tanelso2! |
@Sudha247 Happy to help! Been really excited about algebraic effects as a concept and wanted to learn how to use them |
No description provided.