
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 BOOL) -- Prints "Main.BOOL" (correct) test1 and test2 give different results, even though showType shouldn't be able to tell them apart. It seems that the Typeable context packed with the Lit constructor is wrong in test2. I had to use two extra classes and newtype deriving to trigger this behavior. Note that if I change deriving instance B BOOL to instance B BOOL the result is correct. Tested with both 6.12.3 and 7.0.1. Should I report this as a bug? Thanks! / Emil