Demystifying Type Inference

Demystifying Type Inference


“I’ve chosen this image of a human brain [on the first slide], to be my metaphor for type inference, because it’s very much a black box. Nobody really, certainly I, knows how it works, but I’m going to try and explain a bit about it,” begins Jon Pretty in the preamble to his talk for NE Scala, in equal parts jest and sincerity.

It’s a tricky topic. Jon covers the core ideas, shows what works, what’s doesn’t work and why. He provides some “simple explanations of covariance and contravariance, […] the differences between type parameters and type members, then show[s] how you can exploit type inference with some good design and applied cunning.” Overall, Jon shows us a lot of code and demos a lot of examples.

Further Resources

About the Author

This post is part of Northeast Scala Symposium 2015

If you liked this post you'll probably be interested in these: