3 ms·
The main difference is that typeclasses are injected at compile time rather than run time. By being explicit, I can inject different behavior based on runtime v
by gamegoblin 11y ago
The main difference is that typeclasses are injected at compile time rather than run time. By being explicit, I can inject different behavior based on runtime values.
- platz 11y agowell, the typeclasses are 'determined' at compile-time, but they are certainly de-sugared into extra function paramaters that are still passed around (injected) at run-time. Haskell does not completely specialize this away (even though in theory it could). But i grant you manual threading allows the user to do different things than expected.
- tome 11y agoNot all typeclass instances can be determined at compile time!