summaryrefslogtreecommitdiff
path: root/src/Language/Haskell/GHC/ExactPrint/Utils.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Language/Haskell/GHC/ExactPrint/Utils.hs')
-rw-r--r--src/Language/Haskell/GHC/ExactPrint/Utils.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Language/Haskell/GHC/ExactPrint/Utils.hs b/src/Language/Haskell/GHC/ExactPrint/Utils.hs
index c195340..323b9f7 100644
--- a/src/Language/Haskell/GHC/ExactPrint/Utils.hs
+++ b/src/Language/Haskell/GHC/ExactPrint/Utils.hs
@@ -1,4 +1,5 @@
{-# LANGUAGE CPP #-}
+{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
@@ -325,7 +326,12 @@ extractComments (_,cm)
-- cm has type :: Map SrcSpan [Located AnnotationComment]
= map tokComment . GHC.sortLocated . concat $ Map.elems cm
+#if __GLASGOW_HASKELL__ > 806
+getAnnotationEP :: (Data a,Data (GHC.SrcSpanLess a),GHC.HasSrcSpan a)
+ => a -> Anns -> Maybe Annotation
+#else
getAnnotationEP :: (Data a) => GHC.Located a -> Anns -> Maybe Annotation
+#endif
getAnnotationEP la as =
Map.lookup (mkAnnKey la) as