-
Notifications
You must be signed in to change notification settings - Fork 81
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
Map async #162
Map async #162
Conversation
Codecov Report
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #162 +/- ##
==========================================
+ Coverage 97.41% 97.52% +0.11%
==========================================
Files 4 4
Lines 464 565 +101
==========================================
+ Hits 452 551 +99
- Misses 12 14 +2
|
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.
Looks good, but we'll need to rebase the commit on top of other do_async PR after it's merged
There's a few other methods that accepts a Also I guess this would create a divide between async functions and non-async functions without a possible way to merge the two worlds? Function coloring problem? Does this mean we'd forever have to have a |
I agree it makes sense to do this in one batch, but I think we should get this one shipped since it's ready. The rest of the methods kind of seem like long-tail usage anyway. Interesting read - need to look into how Go does async. But yes, I think if you have async, it has to be separate forever. We've basically extended this library to provide not only the Result monad, but also a second composite async-Result monad.
https://gist.github.com/peter-leonov/c86720d1517235a1f28cd453a9d39bb4 |
Some languages don't suffer from the function coloring problem, Zig if I recall and Go like you mention. I don't know if there's any possible solution in Python land sadly. Makes sense, we can defer the others in a separate PR. Let me know when you've resolved some of the conflicts, I'll review then. |
hmm, might be really a stretch, but would it be possible to implement do-notation for a Result monad with async/await syntax? I'm not sure what it would look like...and it may be quite confusing possibly.
What if Just a random idea since the generator based do approach didn't work out due to typing issues/limitations. Also found this, not sure if it's at all applicable, I haven't really understood these things to fully comprehend the magic that's involved in monads or effects -- https://garciat.com/posts/python-algebraic-effects-async-await |
Resolved the merge conflicts and merged in #165 |
like map, but async. Similar to the PR that added and_then_async.