chainable-components icon indicating copy to clipboard operation
chainable-components copied to clipboard

Do notation is awkward

Open DanielFGray opened this issue 7 years ago • 1 comments

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

DanielFGray avatar Sep 05 '18 02:09 DanielFGray

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)

pfgray avatar Sep 05 '18 03:09 pfgray