Cost of Overloading vs. HOFs
skaller at users.sourceforge.net
Fri May 4 20:59:37 EDT 2007
On Fri, 2007-05-04 at 17:06 -0700, Conal Elliott wrote:
> Cool. You know which types to consider because jhc is a whole-program
> Given the whole program, why not monomorphize, and inline away all of
> the dictionaries?
That's what Felix does: typeclasses, no dictionaries:
whole program analyser: resolves typeclasses, inlines
whilst resolving typeclasses, monomorphises resolving
typeclasses, and inlines again resolving typeclassses.
Indirect dispatch can't be eliminated if the
method is wrapped in a polymorphic closure.
Monomorphisation alone can't eliminate second order
polymorphism. [But Felix doesn't support that anyhow]
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net
More information about the Glasgow-haskell-users