Fix compilation errors on ghc < 7.8
This commit is contained in:
parent
11acd93bf6
commit
063ca80946
@ -1,3 +1,5 @@
|
|||||||
|
{-# LANGUAGE CPP #-}
|
||||||
|
|
||||||
module Language.Haskell.GhcMod.CaseSplit (
|
module Language.Haskell.GhcMod.CaseSplit (
|
||||||
splitVar
|
splitVar
|
||||||
, splits
|
, splits
|
||||||
@ -71,7 +73,12 @@ getSrcSpanTypeForSplit modSum lineNo colNo = do
|
|||||||
tcm@TypecheckedModule{tm_typechecked_source = tcs} <- G.typecheckModule p
|
tcm@TypecheckedModule{tm_typechecked_source = tcs} <- G.typecheckModule p
|
||||||
let bs:_ = listifySpans tcs (lineNo, colNo) :: [LHsBind Id]
|
let bs:_ = listifySpans tcs (lineNo, colNo) :: [LHsBind Id]
|
||||||
varPat = find isPatternVar $ listifySpans tcs (lineNo, colNo) :: Maybe (LPat 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
|
case varPat of
|
||||||
Nothing -> return Nothing
|
Nothing -> return Nothing
|
||||||
Just varPat' -> do
|
Just varPat' -> do
|
||||||
|
@ -24,7 +24,7 @@ import qualified Class as Ty
|
|||||||
#if __GLASGOW_HASKELL__ >= 706
|
#if __GLASGOW_HASKELL__ >= 706
|
||||||
import OccName (occName)
|
import OccName (occName)
|
||||||
#else
|
#else
|
||||||
import OccName (rdrNameOcc)
|
import RdrName (rdrNameOcc)
|
||||||
#endif
|
#endif
|
||||||
import qualified Language.Haskell.Exts.Annotated as HE
|
import qualified Language.Haskell.Exts.Annotated as HE
|
||||||
|
|
||||||
|
@ -78,7 +78,9 @@ newtype GhcMod a = GhcMod {
|
|||||||
deriving (Functor,
|
deriving (Functor,
|
||||||
Applicative,
|
Applicative,
|
||||||
Monad,
|
Monad,
|
||||||
|
#if __GLASGOW_HASKELL__ >= 708
|
||||||
MonadIO,
|
MonadIO,
|
||||||
|
#endif
|
||||||
MonadReader GhcModEnv,
|
MonadReader GhcModEnv,
|
||||||
MonadWriter GhcModWriter,
|
MonadWriter GhcModWriter,
|
||||||
MonadState GhcModState)
|
MonadState GhcModState)
|
||||||
|
Loading…
Reference in New Issue
Block a user