Skip to content

Conversation

@lloydmeta
Copy link
Contributor

I think in traverse_ what is discarded is the B in G[B], rather than the A in the original F[A].

I think in `traverse_` what is discarded is the `B` in `G[B]`, rather than the `A` in the original `F[A]`.
@juanpedromoreno
Copy link
Contributor

Thanks for your time @lloydmeta .

It's written according to https://github.com/typelevel/cats/blob/master/core/src/main/scala/cats/Foldable.scala#L204

Therefore:

This method is primarily useful when `G[_]` represents an action or effect, and the specific `A` aspect of `G[A]` is not otherwise needed.

Does it make sense to you?

@lloydmeta
Copy link
Contributor Author

lloydmeta commented Dec 28, 2016

I think that sentences is OK if it was read by itself in isolation (in which case A is clearly just a placeholder example type parameter), but that is not the case in cats nor this tutorial.

In both cases, they follow reference of a G[B] right within the same comment block and in cats, that sentence is right above the type signature where G[B] is used.

As a reader, you start off reading about A values in F[A] being mapped into G[B], then all of a sudden you're reading about G[A], and need to back track to try and figure out what the writer was trying to say.

@juanpedromoreno
Copy link
Contributor

Got it, thanks for the detailed explanation.

It makes totally sense. Thanks!

@juanpedromoreno juanpedromoreno merged commit 8ce7664 into scala-exercises:master Dec 28, 2016
@lloydmeta lloydmeta deleted the patch-1 branch December 29, 2016 02:32
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.

2 participants