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

added traverseM #108

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

added traverseM #108

wants to merge 1 commit into from

Conversation

dwhitney
Copy link

I find myself using the following so often, that I assumed the function should already exist, but it doesn't:
join <$> traverse fn traversable

I've inquired on slack about it, I have see someone else inquire about it (i-am-the-slime), and someone else inquired on reddit: https://www.reddit.com/r/purescript/comments/aq31gu/i_feel_like_this_is_probably_a_standard_function/

@puffnfresh showed us that it exists in Scalaz: https://github.com/scalaz/scalaz/blob/series/7.3.x/core/src/main/scala/scalaz/Traverse.scala#L68

So I decided to make this PR to add it to Data.Traversable

@hdgarrood
Copy link
Contributor

If we're adding this, we should also add a sequenceM at the same time (where sequenceM would be \x -> join <$> sequence x). The example you give here would probably serve better as an example for sequenceM. Also I think the definitions should be included in the docs.

@JordanMartinez
Copy link
Contributor

Does this pass the Fairbairn Threshold? I think we should add it, but thought it's worth discussing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants