-
Notifications
You must be signed in to change notification settings - Fork 182
Add filterM #120
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
base: master
Are you sure you want to change the base?
Add filterM #120
Conversation
Thus far, this proposal has gotten good reception on the libraries list.
Have you benchmarked and showed that it's faster than |
Oh, you mean |
The bigger question here is: should we add applicative versions of every function to the containers API? There's an argument to be made for it. You might want to perform some effect when doing e.g. an |
There's been a big trend to move away from lists as the only container type that gets a lot of good functions, and I personally think that's a good thing. Making people roll their own functions to use |
Appologies if this is too tangential: I haven't seen a proposal but is there any reason why
Then not every data structure would have to provide its own implementation of these functions since it would just use the Foldable instance, which Sequence already has. This is obviously a much larger change, but was wondering if this has been considered. Edit: duh, this doesn't have the same type as the filterM in the PR. |
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.
This implementation looks kind of silly, since it suspends the insertions till the end. A monadic version can build the result sequence eagerly as it goes.
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.
Requesting changes based on @treeowl's review:
This implementation looks kind of silly, since it suspends the insertions till the end. A monadic version can build the result sequence eagerly as it goes.
Thus far, this proposal has gotten good reception on the libraries
list.