4 ms·
I think the dilemma with Haskell typeclasses isn't the "how", that is fairly straightforward especially for lists and maybe. Instead it is the "why". Groking l
by Guvante 11y ago
I think the dilemma with Haskell typeclasses isn't the "how", that is fairly straightforward especially for lists and maybe.
Instead it is the "why". Groking lens was probably the first time I truly understood why type classes have laws. Unfortunately no one has found an easy path to figuring that out, it takes a long time to truly understand the mechanics of the type classes and a bit longer still to understand why they are useful.
- catnaroek 11y ago> why type classes have laws. No idea about other communities, but C++ programmers have understood this for ages. Stepanov put it quite nicely: “Algorithms are defined on algebraic structures.” And algebraic structures are defined by their equational laws.
- Sirenos 11y agoI always found it a bit amusing that learning Haskell actually helped me get a deeper understanding of C++ templates and metaprogramming.