Why can't I get a show here?
{-# LANGUAGE ExistentialQuantification #-} data Obj = forall a. (Show a) => Item_Obj {get :: a, rest :: Obj} | No_Obj deriving Show xs :: Obj xs = Item_Obj 1 $ Item_Obj "foo" $ Item_Obj 'c' $ No_Obj main :: IO () main = putStrLn . show $ xs
This type of context is not allowed in haskell-98 data types. Read this
Of course, you can write a separate instance using the extension StandaloneDerivingand let ghc do the rest of the work.
StandaloneDeriving
deriving instance Show Obj
Mostly because the GHC's head explodes when you try to do it. In other words, he was simply not taught to derive instances for existential types. Wait for several version numbers to pass, then try again.