> The problem with this is that there is a performance penalty to be
> paid for overloading a function in this way.  `take' is implemented as
> a function of two arguments, as you would expect.  It is given a
> number and a list; it has no idea what type the list has, nor does it
> need to: it just picks elements off it and returns them.

In Hugs, there's no need to do the dictionary passing because it has a
polymorphic show function (used to be called show', is it something like
primShow now?).  In GHC, you can't do this kind of built-in overloading
because there isn't enough type information in the heap at run-time, so
you'd have to do the dictionary passing.

Cheers,
        Simon

Reply via email to