-
Notifications
You must be signed in to change notification settings - Fork 16
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
Add Sequence intent. #46
Conversation
Hey Tom, glad to see you're still interested in Effect :) I can see how this offers something beyond manually chaining effects -- managing the list of results is pretty tedious in Python, but I have two questions:
|
to @radix, for future reference: http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.50.2961 |
sequence = foldM (\x y -> return (x ++ [y])) [] but I don't think that that is simpler. |
Could you check out #51 and #52? I think this is a nicer formulation. Basically I just split up the "folding over effects" part of your PR from the "accumulating into a list" part. The error-handling is generalized to all folds, such that it raises a FoldError with the accumulator-so-far (not necessarily a list) and the original exception. I've also kept the optimization of appending to a list instead of concatenating lists. I also dropped the intent. I can't think of a good reason to have an intent for it because tests would still just need to assert that each effect is performed in turn (usually with |
closing since #52 was merged. Thanks for the contribution. |
No description provided.