Commits

Mateusz Kowalczyk committed b9f97fe

Follow TH changes in GHC 7.9.

Pred now is just an alias of Type. See GHC Trac #7021.

Comments (0)

Files changed (1)

   where
     fromCons :: [TyVarBndr] -> [Con] -> Q Dec
     fromCons tvbs cons =
+#if __GLASGOW_HASKELL__ >= 709
+        instanceD (return $ map (\t -> AppT (ConT ''ToJSON) (VarT t)) typeNames)
+#else
         instanceD (return $ map (\t -> ClassP ''ToJSON [VarT t]) typeNames)
+#endif
                   (classType `appT` instanceType)
                   [ funD 'toJSON
                          [ clause []
   where
     fromCons :: [TyVarBndr] -> [Con] -> Q Dec
     fromCons tvbs cons =
+#if __GLASGOW_HASKELL__ >= 709
+        instanceD (return $ map (\t -> AppT (ConT ''FromJSON) (VarT t)) typeNames)
+#else
         instanceD (return $ map (\t -> ClassP ''FromJSON [VarT t]) typeNames)
+#endif
                   (classType `appT` instanceType)
                   [ funD 'parseJSON
                          [ clause []