[Haskell-cafe] About 'Overloaded functions are not your friend' line in GHC manual
Johannes Waldmann
johannes.waldmann at htwk-leipzig.de
Fri Jan 11 18:03:39 UTC 2019
At run-time, only the branch (Left/Right) is "picked" at run-time.
For each branch, the "show" instance is determined at compile-time.
The problem is that such instances are represented by dictionaries,
and this adds extra cost (extra arguments) to function calls -
but only in those cases where these dictionaries
are not inlined (that is, removed) statically.
But I am thinking that GHC has become very good at inlining.
- J.W.
More information about the Haskell-Cafe
mailing list