[Haskell-cafe] Consequences of newtype deriving implementation w.r.t. base classes

2007-03-13 Thread Twan van Laarhoven
I just noticed some unexpected consequences of the way newtype deriving is implemented in GHC. Because the dictionary of the underlying type is reused, so are base classes. This message is a literate Haskell program illustrating the problem. {-# OPTIONS_GHC -fglasgow-exts #-} This problem

RE: [Haskell-cafe] Consequences of newtype deriving implementation w.r.t. base classes

2007-03-13 Thread Simon Peyton-Jones
| I just noticed some unexpected consequences of the way newtype deriving | is implemented in GHC. Because the dictionary of the underlying type is | reused, so are base classes. This message is a literate Haskell program | illustrating the problem. Excellent point. | As a solution I would