Hugs faster than GHC

Bernd Brassel bbr at
Fri Dec 14 07:59:27 EST 2007

The following program reveals a performance bug in ghc 6.6

module HCBenchmark where

type M1 a = ()
type M2 a = M1 a
type M3 a = M2 a
type M4 a = M3 a
type M5 a = M4 a

type M a = M4 a -- use M5 for 10 times the compile time and M3 for 1/10

f :: M (M (M (M (M (M (M (M (M (M x)))))))))
f = ()

Each element you add in the chain of type synonyms adds a factor of ten
to the compile time. Hugs is "a bit" faster :o)

Trouble is, the module I wanted to compile originally, takes an
estimated 6 thousand and 600 hours to compile and I am not sure that
this bug is the only obstacle for the compiler ...

Could anyone cope if that is still a problem with the newest instance of

Thanks a lot

More information about the Glasgow-haskell-users mailing list