From dc023cee45d7b42028851830f9310b9cbe72fbed Mon Sep 17 00:00:00 2001 From: alexwl Date: Sun, 29 Sep 2019 13:45:37 +0300 Subject: Make it compile with GHC-8.8.1 (Stackage nightly-2019-09-28) --- src/HaskellCodeExplorer/GhcUtils.hs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/HaskellCodeExplorer/GhcUtils.hs') diff --git a/src/HaskellCodeExplorer/GhcUtils.hs b/src/HaskellCodeExplorer/GhcUtils.hs index bb89832..0f3ff1c 100644 --- a/src/HaskellCodeExplorer/GhcUtils.hs +++ b/src/HaskellCodeExplorer/GhcUtils.hs @@ -25,6 +25,7 @@ module HaskellCodeExplorer.GhcUtils , hsGroupVals , hsPatSynDetails , ieLocNames + , ghcDL -- * Lookups , lookupIdInTypeEnv , lookupNameModuleAndPackage @@ -165,6 +166,11 @@ import GHC , tfe_pats #endif , tfid_eqn +#if MIN_VERSION_ghc(8,8,0) + , dL + , HasSrcSpan + , SrcSpanLess +#endif ) import qualified HaskellCodeExplorer.Types as HCE @@ -1203,7 +1209,7 @@ isUserLSig (L _ ClassOpSig {}) = True isUserLSig _ = False #if MIN_VERSION_GLASGOW_HASKELL(8,4,3,0) -getMainDeclBinder :: HsDecl pass -> [IdP pass] +getMainDeclBinder :: HsDecl GhcRn -> [IdP GhcRn] #else getMainDeclBinder :: HsDecl name -> [name] #endif @@ -1401,3 +1407,11 @@ makeAnchorId (f:r) = escape isAlpha f ++ concatMap (escape isLegal) r isLegal '_' = True isLegal '.' = True isLegal c = isAscii c && isAlphaNum c + +#if MIN_VERSION_ghc(8,8,0) +ghcDL :: GHC.HasSrcSpan a => a -> GHC.Located (GHC.SrcSpanLess a) +ghcDL = GHC.dL +#else +ghcDL :: GHC.Located a -> GHC.Located a +ghcDL x = x +#endif -- cgit v1.2.3