python-effect / effect

effect isolation in Python, to facilitate more purely functional code
372 stars 16 forks source link

Iter performer #81

Closed Tomatosoup97 closed 4 years ago

Tomatosoup97 commented 5 years ago

Hello. I've found myself in need to have actual generators among the effectful code - or in other words, to have a standard python generator that uses effects. This library already relies on yield syntax, so it's not straighforward, and thus I wrote a peformer to do that.

I think that the code turned out to be generic enough to (maybe) be incorporated into the upstream - the need for actual generators seems like a simple and reocurring thing.

Obvious issues with the PR:

I did not bother myself yet to address these issues. Instead, at first I would like to hear your opinion and whether you would like to see something like that in the repo, and then I can polish the details. Tests are here natural usage examples.

Tomatosoup97 commented 5 years ago

@radix

radix commented 5 years ago

Thanks for the contribution! I've started looking at it, but it's going to take me a while to absorb it.

radix commented 4 years ago

Closing this for now. If you ever feel like reopening the discussion, just comment here and I can reopen the PR.