In Haskell, you're right, you do this by putting every primitive function in its own typeclass.
And you're also right that generally you can figure that stuff out statically.
But in Haskell (or rather GHC), sadly, you generally don't get that static analysis, and instead you end up with functions passing dictionaries/virtual-function-table-pointers around all the time.
no subject
And you're also right that generally you can figure that stuff out statically.
But in Haskell (or rather GHC), sadly, you generally don't get that static analysis, and instead you end up with functions passing dictionaries/virtual-function-table-pointers around all the time.