runtime effect of polymorphic Array.!

Johannes Waldmann
Wed, 28 Nov 2001 15:06:42 +0100 (MET)

Of course (!) is polymorphic

  (!) :: Ix a => Array a b -> a -> b

but on the other hand the GHC manual says

  Overloaded functions are not your friend:
    Haskell's overloading (using type classes) is elegant, 
    neat, etc., etc., but
    it is death to performance if left to linger in an inner loop. 

I assume (!) is inlined and specialized by GHC, 
but what does  hugs  do? Does it build and pass around
dictionaries all the time I index an array?

(In my case, I am forced to use (run)hugs.)

Just curious,
-- Johannes Waldmann ---- --
-- -- phone/fax (+49) 341 9732 204/252 --