underscoreio/essential-scala

Revisit explanation of co- and contravariance

Opened this issue · 1 comments

A reader, Allan Lim, writes

Happy new year! I hope you are doing great! I actually love to read your books above all Scala books available in the market. If I can make some suggestions, the explanation about covariant, invariant and contravariant in "Essential Scala" is not adequate. I think if you provide more example, it will help a lot.

Something similar to this - http://julien.richard-foy.fr/blog/2013/02/21/be-friend-with-covariance-and-contravariance/ would probably suffice.

Take a look at our description of variance in light of the above and see if it can be improved.

I've put a new explanation in Advanced Scala (in the end of the functors chapter) that may provide good material for this.