conditional typeable deriving for ghc versions