scalawithcats / scala-with-cats

Source code for Scala with Cats
http://underscore.io/books/scala-with-cats
396 stars 133 forks source link

Misleading Typo in 3.6. CONTRAVARIANT AND INVARIANT FUNCTORS #136

Closed dadepo closed 4 years ago

dadepo commented 6 years ago

In the orange callout section in section 3.6.2.1 you have the following:

Subtyping can be viewed as a conversion. If B is a subtype of A, we can
always convert a B to an A.

Equivalently we could say that B is a subtype of A if there exists a function A => B.

Those two statement sounds contradictory. First one says B is a Subtype of A if we can convert a B to an A, so It would be expected the function signature in the second line to be B => A. Instead of B => A.

This is a typo that affects comprehensibility, as it became really difficult to understand exactly the point being made due to this typo.

noelwelsh commented 4 years ago

Thanks! Fixed in the current source.