Cost of Overloading vs. HOFs

Conal Elliott conal at
Fri May 4 18:07:41 EDT 2007

Does anyone know what became of Dictionary-free Overloading by Partial
Evaluation <>?  Is it
impractical for some reason?

On 5/4/07, Adrian Hey <ahey at> wrote:
> Hello,
> The GHC users guide says overloading "is death to performance if
> left to linger in an inner loop" and one thing I noticed while
> playing about with the AVL lib was that using a HOF and passing
> the (overloaded) compare function as an explicit argument at the
> start seemed to give noticable a performance boost (compared with
> dictionary passing presumably).
> I'm not sure why that should be, but has anyone else noticed this?
> If so, maybe this advice should be added to the user guide, especially
> if your function repeatedly uses just one method from a class?
> (or maybe not if it's nonsense :-)
> I guess having done this there would be little to gain by using the
> SPECIALIZE pragma though (unless ghc also specialises HOFs).
> Regards
> --
> Adrian Hey
> _______________________________________________
> Glasgow-haskell-users mailing list
> Glasgow-haskell-users at
-------------- next part --------------
An HTML attachment was scrubbed...

More information about the Glasgow-haskell-users mailing list