Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In Haskell typeclasses, it's the type of the parameter that is implicitly passed, not the parameter itself.


i don't think that's correct, afaik typeclasses roughly desugar to passing a record of functions (vtable/"dictionary") at the call site


And that vtable depends on the type, not the value.


i 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




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: