3 ms·
In Haskell typeclasses, it's the type of the parameter that is implicitly passed, not the parameter itself.
by js8 6y ago
In Haskell typeclasses, it's the type of the parameter that is implicitly passed, not the parameter itself.
- uryga 6y agoi don't think that's correct, afaik typeclasses roughly desugar to passing a record of functions (vtable/"dictionary") at the call site
- taejo 6y agoAnd that vtable depends on the type, not the value.
- uryga 6y agoi guess there's really two implicit arguments - the value's type, `a` (quantified via forall - the System F "Λ") and its vtable `Show a`... though i guess the vtable is uniquely determined by the type bc in Haskell instances are globally unique