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

Misleading Figure 3.7 - Function1 Contramap #229

Open
victorcrrd opened this issue Jan 19, 2023 · 1 comment
Open

Misleading Figure 3.7 - Function1 Contramap #229

victorcrrd opened this issue Jan 19, 2023 · 1 comment

Comments

@victorcrrd
Copy link

I am having trouble understanding Figure 3.7 on the Contramap Typeclass for Function1.
Looking at Figure 3.5, we have the typeclass instance F[B], the "function to be prepended" A => B and the resulting typeclass instance F[A]. So in the case of Figure 3.7 we have that the type produced by contramap is Function1[Pentagon, Star], which means that we are working with the Contramap Functor instance of functions consuming the base type and producing the Star type. And thus, the image on the left should be an instance of the same typeclass, and the right-hand side of the arrow should be a star too.
Another way to interpret the Figure is that the black arrows in the drawings are reversed, but I think that is a bit misleading.

@noelwelsh
Copy link
Contributor

noelwelsh commented Jan 20, 2023

Thanks for bringing this up. I think Figure 3.7 is in error. I'm going to leave this up so when we (eventually) get around to this part of the book it can be fixed.

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

No branches or pull requests

2 participants