Y
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
comex
4331 days ago
To be fair, most of these classes come with "laws" instances are supposed to follow, which are not encoded in the language...
link
Fixnum
4331 days ago
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.
link
eru
4331 days ago
Good point!
link
Dewie
4331 days ago
That was partly my point, at least for functional languages that can express these concepts, like certain statically typed ones.
link