3 ms·
The typeclass approach can be just as surprising. Possibly more so, because it means that a type's implementation of a class can come from literally anywhere. S
by bunderbunder 8y ago
The typeclass approach can be just as surprising. Possibly more so, because it means that a type's implementation of a class can come from literally anywhere. So the universe of surprises still includes "Surprise! It's not hashable!", but now also includes, "Surprise! It was hashable, but now isn't, because you stopped importing this seemingly unrelated package."
If you do get surprised that X doesn't support Y, though, you have ability to provide your own implementation without resorting to monkey patching.
- sevensor 8y agoThat's a good point! I suppose the grass is always greener...