Skip to content
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

Do notation is awkward #18

Open
DanielFGray opened this issue Sep 5, 2018 · 1 comment
Open

Do notation is awkward #18

DanielFGray opened this issue Sep 5, 2018 · 1 comment

Comments

@DanielFGray
Copy link

Would it be possible for .Do to accept a generator function?

@pfgray
Copy link
Owner

pfgray commented Sep 5, 2018

Unfortunately not, for reasons described here.

I did attempt this in the monad_composition branch. It works great on the first render, but if there's ever a re-render, then it doesn't work, since the generator attempts to continue, rather than re-start from the point of the render. Here's an example of how it's used.

You're welcome to pull & play around with it (I'd love to find a way around this, but don't really see one)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants