@@ -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 ++