essential-scala icon indicating copy to clipboard operation
essential-scala copied to clipboard

Revisit explanation of co- and contravariance

Open noelwelsh opened this issue 9 years ago • 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.

noelwelsh avatar Jan 04 '16 19:01 noelwelsh

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

davegurnell avatar Aug 29 '17 11:08 davegurnell