3 ms·
That's interesting. I've read a paper about it, but I don't remember exactly. Is it implemented in GHC? Type classes are more powerful in some ways, but much l
by jules 16y ago
That's interesting. I've read a paper about it, but I don't remember exactly. Is it implemented in GHC?
Type classes are more powerful in some ways, but much less powerful in other ways. There is some overlap, but type classes dispatch only on the compile time type whereas this dispatches on run time predicates.
- eru 16y agoI agree. About more powerful: The static approach allows you to dispatch not only on argument types, but also on return type. A quick search reveals that there is some support for open data types in GHC, but I am not sure if it's more than an experimental feature.