Skip to content
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 mapMaybeM #214

Closed
vrom911 opened this issue Oct 21, 2019 · 5 comments · Fixed by #223
Closed

Add mapMaybeM #214

vrom911 opened this issue Oct 21, 2019 · 5 comments · Fixed by #223
Assignees
Labels
new Bring something new into library (add function or type or interface) question Further information is requested

Comments

@vrom911
Copy link
Member

vrom911 commented Oct 21, 2019

With the type

mapMaybeM :: (a -> m (Maybe b)) -> f a -> m (f b)
@vrom911 vrom911 added question Further information is requested new Bring something new into library (add function or type or interface) labels Oct 21, 2019
@chshersh chshersh added this to the v0.6.0.0: Refinement milestone Oct 21, 2019
@josephcsible
Copy link
Contributor

That looks exactly like wither. How do you plan to implement it without the Filterable or Witherable typeclasses?

@chshersh
Copy link
Contributor

@josephcsible Specialization to [] should work for now 👍 And once something like Witherable gets into base (or at least boot libraries), we can easily generalise this function.

vrom911 added a commit that referenced this issue Oct 29, 2019
@vrom911 vrom911 mentioned this issue Oct 29, 2019
10 tasks
chshersh pushed a commit that referenced this issue Oct 29, 2019
@josephcsible
Copy link
Contributor

Can we change this to use traverse instead of mapM, so that it can support applicatives that aren't monads?

@chshersh
Copy link
Contributor

@josephcsible Do you have a particular use case in mind?

@josephcsible
Copy link
Contributor

Not offhand. I just ask because that's how wither is, and I can't think of a good reason to have a new function be less general than it could otherwise be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new Bring something new into library (add function or type or interface) question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants