Fix compilation errors on ghc < 7.8

This commit is contained in:
Alejandro Serrano 2014-07-01 17:43:13 +02:00
parent 11acd93bf6
commit 063ca80946
3 changed files with 11 additions and 2 deletions

View File

@ -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

View File

@ -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

View File

@ -78,7 +78,9 @@ newtype GhcMod a = GhcMod {
deriving (Functor,
Applicative,
Monad,
#if __GLASGOW_HASKELL__ >= 708
MonadIO,
#endif
MonadReader GhcModEnv,
MonadWriter GhcModWriter,
MonadState GhcModState)