Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
js8
on May 28, 2020
|
parent
|
context
|
favorite
| on:
The use of `class` for things that should be simpl...
In Haskell typeclasses, it's the type of the parameter that is implicitly passed, not the parameter itself.
uryga
on May 28, 2020
[–]
i don't think that's correct, afaik typeclasses roughly desugar to passing a record of functions (vtable/"dictionary") at the call site
taejo
on May 28, 2020
|
parent
[–]
And that vtable depends on the type, not the value.
uryga
on May 28, 2020
|
root
|
parent
[–]
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: