on master help sign in
Fix for GHC 7.8
363c250Hamish Mackenzie
Data/Aeson/Generic.hs+13−1
@@ -1,4 +1,4 @@
1−{-# LANGUAGE PatternGuards, Rank2Types, ScopedTypeVariables #-}
1+{-# LANGUAGE PatternGuards, Rank2Types, ScopedTypeVariables, CPP #-}
2
2
3-- |
3-- |
4-- Module: Data.Aeson.Generic
4-- Module: Data.Aeson.Generic
@@ -339,21 +339,33 @@ modError func err = error $ "Data.Aeson.Generic." ++ func ++ ": " ++ err
339-- Type extension for binary type constructors.
339-- Type extension for binary type constructors.
340
340
341-- | Flexible type extension
341-- | Flexible type extension
342+#if MIN_VERSION_base(4,7,0)
343+ext2' :: (Data a, Typeable t)
344+#else
342ext2' :: (Data a, Typeable2 t)
345ext2' :: (Data a, Typeable2 t)
346+#endif
343 => c a
347 => c a
344 -> (forall d1 d2. (Data d1, Data d2) => c (t d1 d2))
348 -> (forall d1 d2. (Data d1, Data d2) => c (t d1 d2))
345 -> c a
349 -> c a
346ext2' def ext = maybe def id (dataCast2 ext)
350ext2' def ext = maybe def id (dataCast2 ext)
347
351
348-- | Type extension of queries for type constructors
352-- | Type extension of queries for type constructors
353+#if MIN_VERSION_base(4,7,0)
354+ext2Q' :: (Data d, Typeable t)
355+#else
349ext2Q' :: (Data d, Typeable2 t)
356ext2Q' :: (Data d, Typeable2 t)
357+#endif
350 => (d -> q)
358 => (d -> q)
351 -> (forall d1 d2. (Data d1, Data d2) => t d1 d2 -> q)
359 -> (forall d1 d2. (Data d1, Data d2) => t d1 d2 -> q)
352 -> d -> q
360 -> d -> q
353ext2Q' def ext = unQ ((Q def) `ext2'` (Q ext))
361ext2Q' def ext = unQ ((Q def) `ext2'` (Q ext))
354
362
355-- | Type extension of readers for type constructors
363-- | Type extension of readers for type constructors
364+#if MIN_VERSION_base(4,7,0)
365+ext2R' :: (Monad m, Data d, Typeable t)
366+#else
356ext2R' :: (Monad m, Data d, Typeable2 t)
367ext2R' :: (Monad m, Data d, Typeable2 t)
368+#endif
357 => m d
369 => m d
358 -> (forall d1 d2. (Data d1, Data d2) => m (t d1 d2))
370 -> (forall d1 d2. (Data d1, Data d2) => m (t d1 d2))
359 -> m d
371 -> m d