4 ms·
Can you elaborate on what you mean by "typeclass dispatch is static"? I believe typeclasse in Haskell at least are lowered to an array of method, i.e. a vtable
by deredede 3y ago
Can you elaborate on what you mean by "typeclass dispatch is static"?
I believe typeclasse in Haskell at least are lowered to an array of method, i.e. a vtable, and (single) dispatch happens at runtime.
- whateveracct 3y agoYep they desugar to dictionary-passing (vtable)..buuuut GHC is a helluva optimizing compiler and will often effectively make them static.
- deredede 3y agoI mean, sure, you can optimize a lot of the common cases (C++ compilers do the same), but that doesn't make the dispatch static, semantically.
- whateveracct 3y agoIt's static dispatch when it's monomorphic, I'd say.