RE: Newtype deriving mixing up types

2010-12-17 Thread Simon Peyton-Jones
| To: glasgow-haskell-users@haskell.org | Subject: Newtype deriving mixing up types | | Hello! | | I attach a program which I suspect demonstrates a bug in GHC. The important | lines are: | |showType :: forall a . Expr a -> String |showType (Lit _) = show (typeOf (undefined :: a)) | |

Newtype deriving mixing up types

2010-12-16 Thread Emil Axelsson
Hello! I attach a program which I suspect demonstrates a bug in GHC. The important lines are: showType :: forall a . Expr a -> String showType (Lit _) = show (typeOf (undefined :: a)) test1 = showType (mk :: Expr BOOL) -- Prints "Bool" (wrong?) test2 = showType (Lit mk :: Expr BOO