summaryrefslogtreecommitdiff
path: root/src/Language/Haskell/GHC/ExactPrint/Types.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Language/Haskell/GHC/ExactPrint/Types.hs')
-rw-r--r--src/Language/Haskell/GHC/ExactPrint/Types.hs21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/Language/Haskell/GHC/ExactPrint/Types.hs b/src/Language/Haskell/GHC/ExactPrint/Types.hs
index a3ff4b2..152a843 100644
--- a/src/Language/Haskell/GHC/ExactPrint/Types.hs
+++ b/src/Language/Haskell/GHC/ExactPrint/Types.hs
@@ -355,6 +355,25 @@ data ListContexts = LC { lcOnly,lcInitial,lcMiddle,lcLast :: !(Set.Set AstContex
-- ---------------------------------------------------------------------
declFun :: (forall a . Data a => GHC.Located a -> b) -> GHC.LHsDecl GhcPs -> b
+
+#if __GLASGOW_HASKELL__ > 804
+declFun f (GHC.L l de) =
+ case de of
+ GHC.TyClD _ d -> f (GHC.L l d)
+ GHC.InstD _ d -> f (GHC.L l d)
+ GHC.DerivD _ d -> f (GHC.L l d)
+ GHC.ValD _ d -> f (GHC.L l d)
+ GHC.SigD _ d -> f (GHC.L l d)
+ GHC.DefD _ d -> f (GHC.L l d)
+ GHC.ForD _ d -> f (GHC.L l d)
+ GHC.WarningD _ d -> f (GHC.L l d)
+ GHC.AnnD _ d -> f (GHC.L l d)
+ GHC.RuleD _ d -> f (GHC.L l d)
+ GHC.SpliceD _ d -> f (GHC.L l d)
+ GHC.DocD _ d -> f (GHC.L l d)
+ GHC.RoleAnnotD _ d -> f (GHC.L l d)
+ GHC.XHsDecl _ -> error "declFun:XHsDecl"
+#else
declFun f (GHC.L l de) =
case de of
GHC.TyClD d -> f (GHC.L l d)
@@ -374,7 +393,7 @@ declFun f (GHC.L l de) =
#if __GLASGOW_HASKELL__ < 711
GHC.QuasiQuoteD d -> f (GHC.L l d)
#endif
-
+#endif
-- ---------------------------------------------------------------------