Skip to content

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