Hacker News new | ask | show | jobs
by eru 4331 days ago
Type classes are built into the language. So they are not really `design patterns' by the original definition of the word.
2 comments

To be fair, most of these classes come with "laws" instances are supposed to follow, which are not encoded in the language...
On the other hand, the burden of proof is on the library writer who creates the typeclass instance, not on the end user - possible largely thanks to purity - whereas programmers may expect to re-implement various patterns by hand.
Good point!
That was partly my point, at least for functional languages that can express these concepts, like certain statically typed ones.