on master help sign in
Compile with GHC 8.0.1
commit8d32f788c777ad935f87c26f99355731c9aa0df5 authorOleg Grenrus <oleg.grenrus@iki.fi> dateFri 15 Jan 2016, 10:57 (11 years ago) parent4de5a20
3 files changed+29−9
.travis.yml+3 Data/Aeson/TH.hs+21−8 Data/Aeson/Types/Generic.hs+5−1
.travis.yml+3
@@ -25,6 +25,9 @@ matrix:
2525 - env: CABALVER=1.22 GHCVER=7.10.2
2626 compiler: ": #GHC 7.10.2"
2727 addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.2], sources: [hvr-ghc]}}
28+ - env: CABALVER=1.24 GHCVER=8.0.1
29+ compiler: ": #GHC 8.0.1"
30+ addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.1], sources: [hvr-ghc]}}
2831
2932before_install:
3033 - unset CC
Data/Aeson/TH.hs+21−8
@@ -1038,8 +1038,13 @@ withType name f = do
10381038 case info of
10391039 TyConI dec ->
10401040 case dec of
1041− DataD _ _ tvbs cons _ -> f name tvbs cons Nothing
1042− NewtypeD _ _ tvbs con _ -> f name tvbs [con] Nothing
1041+#if MIN_VERSION_template_haskell(2,11,0)
1042+ DataD _ _ tvbs _ cons _ -> f name tvbs cons Nothing
1043+ NewtypeD _ _ tvbs _ con _ -> f name tvbs [con] Nothing
1044+#else
1045+ DataD _ _ tvbs cons _ -> f name tvbs cons Nothing
1046+ NewtypeD _ _ tvbs con _ -> f name tvbs [con] Nothing
1047+#endif
10431048 other -> error $ ns ++ "Unsupported type: " ++ show other
10441049#if MIN_VERSION_template_haskell(2,11,0)
10451050 DataConI _ _ parentName -> do
@@ -1054,14 +1059,22 @@ withType name f = do
10541059 FamilyI (FamilyD DataFam _ tvbs _) decs ->
10551060#endif
10561061 let instDec = flip find decs $ \dec -> case dec of
1057− DataInstD _ _ _ cons _ -> any ((name ==) . getConName) cons
1058− NewtypeInstD _ _ _ con _ -> name == getConName con
1062+#if MIN_VERSION_template_haskell(2,11,0)
1063+ DataInstD _ _ _ _ cons _ -> any ((name ==) . getConName) cons
1064+ NewtypeInstD _ _ _ _ con _ -> name == getConName con
1065+#else
1066+ DataInstD _ _ _ cons _ -> any ((name ==) . getConName) cons
1067+ NewtypeInstD _ _ _ con _ -> name == getConName con
1068+#endif
10591069 _ -> error $ ns ++ "Must be a data or newtype instance."
10601070 in case instDec of
1061− Just (DataInstD _ _ instTys cons _)
1062− -> f parentName tvbs cons $ Just instTys
1063− Just (NewtypeInstD _ _ instTys con _)
1064− -> f parentName tvbs [con] $ Just instTys
1071+#if MIN_VERSION_template_haskell(2,11,0)
1072+ Just (DataInstD _ _ instTys _ cons _) -> f parentName tvbs cons $ Just instTys
1073+ Just (NewtypeInstD _ _ instTys _ con _) -> f parentName tvbs [con] $ Just instTys
1074+#else
1075+ Just (DataInstD _ _ instTys cons _) -> f parentName tvbs cons $ Just instTys
1076+ Just (NewtypeInstD _ _ instTys con _) -> f parentName tvbs [con] $ Just instTys
1077+#endif
10651078 _ -> error $ ns ++
10661079 "Could not find data or newtype instance constructor."
10671080 _ -> error $ ns ++ "Data constructor " ++ show name ++
Data/Aeson/Types/Generic.hs+5−1
@@ -2,7 +2,7 @@
22 FunctionalDependencies, KindSignatures,
33 ScopedTypeVariables, TypeOperators, UndecidableInstances,
44 ViewPatterns, NamedFieldPuns, FlexibleContexts, PatternGuards,
5− RecordWildCards #-}
5+ RecordWildCards, DataKinds #-}
66{-# OPTIONS_GHC -fno-warn-orphans #-}
77
88#include "overlapping-compat.h"
@@ -733,7 +733,11 @@ class IsRecord (f :: * -> *) isRecord | f -> isRecord
733733
734734instance (IsRecord f isRecord) => IsRecord (f :*: g) isRecord
735735 where isUnary = const False
736+#if MIN_VERSION_base(4,9,0)
737+instance OVERLAPPING_ IsRecord (M1 S (MetaSel Nothing u ss ds) f) False
738+#else
736739instance OVERLAPPING_ IsRecord (M1 S NoSelector f) False
740+#endif
737741instance (IsRecord f isRecord) => IsRecord (M1 S c f) isRecord
738742instance IsRecord (K1 i c) True
739743instance IsRecord U1 False