diff --git a/Language/Haskell/GhcMod/CaseSplit.hs b/Language/Haskell/GhcMod/CaseSplit.hs index 3cd5aba..3399a3c 100644 --- a/Language/Haskell/GhcMod/CaseSplit.hs +++ b/Language/Haskell/GhcMod/CaseSplit.hs @@ -1,3 +1,5 @@ +{-# LANGUAGE CPP #-} + module Language.Haskell.GhcMod.CaseSplit ( splitVar , splits @@ -71,7 +73,12 @@ getSrcSpanTypeForSplit modSum lineNo colNo = do tcm@TypecheckedModule{tm_typechecked_source = tcs} <- G.typecheckModule p let bs:_ = listifySpans tcs (lineNo, colNo) :: [LHsBind Id] varPat = find isPatternVar $ listifySpans tcs (lineNo, colNo) :: Maybe (LPat Id) - match:_ = listifyParsedSpans pms (lineNo, colNo) :: [G.LMatch G.RdrName (LHsExpr G.RdrName)] + match:_ = listifyParsedSpans pms (lineNo, colNo) +#if __GLASGOW_HASKELL__ < 708 + :: [G.LMatch G.RdrName] +#else + :: [G.LMatch G.RdrName (LHsExpr G.RdrName)] +#endif case varPat of Nothing -> return Nothing Just varPat' -> do diff --git a/Language/Haskell/GhcMod/FillSig.hs b/Language/Haskell/GhcMod/FillSig.hs index 44f137d..8a734b3 100644 --- a/Language/Haskell/GhcMod/FillSig.hs +++ b/Language/Haskell/GhcMod/FillSig.hs @@ -24,7 +24,7 @@ import qualified Class as Ty #if __GLASGOW_HASKELL__ >= 706 import OccName (occName) #else -import OccName (rdrNameOcc) +import RdrName (rdrNameOcc) #endif import qualified Language.Haskell.Exts.Annotated as HE diff --git a/Language/Haskell/GhcMod/Monad.hs b/Language/Haskell/GhcMod/Monad.hs index d08ad11..046a323 100644 --- a/Language/Haskell/GhcMod/Monad.hs +++ b/Language/Haskell/GhcMod/Monad.hs @@ -78,7 +78,9 @@ newtype GhcMod a = GhcMod { deriving (Functor, Applicative, Monad, +#if __GLASGOW_HASKELL__ >= 708 MonadIO, +#endif MonadReader GhcModEnv, MonadWriter GhcModWriter, MonadState GhcModState)