From 31267d352e329875e647fa422d68b08106a36cf2 Mon Sep 17 00:00:00 2001 From: alexwl Date: Fri, 17 May 2019 18:43:42 +0300 Subject: Code cleanup: fix warnings --- src/HaskellCodeExplorer/GhcUtils.hs | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'src/HaskellCodeExplorer/GhcUtils.hs') diff --git a/src/HaskellCodeExplorer/GhcUtils.hs b/src/HaskellCodeExplorer/GhcUtils.hs index 3ac1f86..031f411 100644 --- a/src/HaskellCodeExplorer/GhcUtils.hs +++ b/src/HaskellCodeExplorer/GhcUtils.hs @@ -74,16 +74,17 @@ import DataCon (dataConWorkId, flSelector) import Documentation.Haddock.Parser (overIdentifier, parseParas) import Documentation.Haddock.Types (DocH(..), Header(..), - _doc, -#if MIN_VERSION_GLASGOW_HASKELL(8,4,3,0) - Table(..) -#endif + _doc ) import DynFlags () import FastString (mkFastString, unpackFS) import GHC ( DynFlags - , HsDocString(..) +#if MIN_VERSION_GLASGOW_HASKELL(8,6,1,0) + , HsDocString +#else + , HsDocString (..) +#endif , InstDecl(..) , ModuleName , Name @@ -97,7 +98,11 @@ import GHC , HsGroup(..) , HsBindLR(..) , HsValBindsLR(..) +#if MIN_VERSION_GLASGOW_HASKELL(8,4,1,0) + , HsPatSynDetails +#else , HsPatSynDetails(..) +#endif , Located , IE(..) , TyThing(..) @@ -687,12 +692,12 @@ nameLocationInfo flags currentPackageId compId transformation fileMap defSiteMap Nothing -> approximateLocation where realSrcSpan :: Name -> Maybe SrcSpan -> Maybe RealSrcSpan - realSrcSpan name mbSrcSpan = - case nameSrcSpan name of + realSrcSpan n mbSpan = + case nameSrcSpan n of RealSrcSpan span -> Just span _ - | isWiredInName name -> - case mbSrcSpan of + | isWiredInName n -> + case mbSpan of Just span -> case span of RealSrcSpan s -> Just s @@ -1082,9 +1087,9 @@ ungroup group_ = #endif typesigs _ = [] #if MIN_VERSION_GLASGOW_HASKELL(8,6,1,0) - valbinds (XValBindsLR (NValBinds binds _)) = concatMap bagToList . snd . unzip $ binds + valbinds (XValBindsLR (NValBinds binds _)) = concatMap (bagToList . snd) binds #else - valbinds (ValBindsOut binds _) = concatMap bagToList . snd . unzip $ binds + valbinds (ValBindsOut binds _) = concatMap (bagToList . snd) binds #endif valbinds _ = [] -- cgit v1.2.3