on master help sign in
Fix GHC HEAD build
df144afRyanGlScott
Data/Aeson/TH.hs+15−2
@@ -1035,10 +1035,18 @@ withType name f = do
1035 DataD _ _ tvbs cons _ -> f name tvbs cons Nothing
1035 DataD _ _ tvbs cons _ -> f name tvbs cons Nothing
1036 NewtypeD _ _ tvbs con _ -> f name tvbs [con] Nothing
1036 NewtypeD _ _ tvbs con _ -> f name tvbs [con] Nothing
1037 other -> error $ ns ++ "Unsupported type: " ++ show other
1037 other -> error $ ns ++ "Unsupported type: " ++ show other
1038+#if MIN_VERSION_template_haskell(2,11,0)
1039+ DataConI _ _ parentName -> do
1040+#else
1038 DataConI _ _ parentName _ -> do
1041 DataConI _ _ parentName _ -> do
1042+#endif
1039 parentInfo <- reify parentName
1043 parentInfo <- reify parentName
1040 case parentInfo of
1044 case parentInfo of
1045+#if MIN_VERSION_template_haskell(2,11,0)
1046+ FamilyI (DataFamilyD _ tvbs _) decs ->
1047+#else
1041 FamilyI (FamilyD DataFam _ tvbs _) decs ->
1048 FamilyI (FamilyD DataFam _ tvbs _) decs ->
1049+#endif
1042 let instDec = flip find decs $ \dec -> case dec of
1050 let instDec = flip find decs $ \dec -> case dec of
1043 DataInstD _ _ _ cons _ -> any ((name ==) . getConName) cons
1051 DataInstD _ _ _ cons _ -> any ((name ==) . getConName) cons
1044 NewtypeInstD _ _ _ con _ -> name == getConName con
1052 NewtypeInstD _ _ _ con _ -> name == getConName con
@@ -1052,8 +1060,13 @@ withType name f = do
1052 "Could not find data or newtype instance constructor."
1060 "Could not find data or newtype instance constructor."
1053 _ -> error $ ns ++ "Data constructor " ++ show name ++
1061 _ -> error $ ns ++ "Data constructor " ++ show name ++
1054 " is not from a data family instance constructor."
1062 " is not from a data family instance constructor."
1063+#if MIN_VERSION_template_haskell(2,11,0)
1064+ FamilyI DataFamilyD{} _ ->
1065+#else
1055− FamilyI (FamilyD DataFam _ _ _) _ -> error $ ns ++
1066+ FamilyI (FamilyD DataFam _ _ _) _ ->
1067+#endif
1068+ error $ ns ++
1056− "Cannot use a data family name. Use a data family instance constructor instead."
1069+ "Cannot use a data family name. Use a data family instance constructor instead."
1057 _ -> error $ ns ++ "I need the name of a plain data type constructor, "
1070 _ -> error $ ns ++ "I need the name of a plain data type constructor, "
1058 ++ "or a data family instance constructor."
1071 ++ "or a data family instance constructor."
1059 where
1072 where