Type classes are something that long frustrated my attempts at understanding them, until I finally did and realised the problem was that they were much simpler than I’d ever imagined.
This discovery completely changed the way I write code, and the purpose of this article is to share that understanding. After reading it, you should understand what type classes are, how they work and what purpose they serve.
The way it finally clicked for me was by writing my own CSV parsing and decoding library, so in order to try and reproduce my experience, we’ll be doing a somewhat simplified version of that.