diff --git a/Language/Haskell/GhcMod/Check.hs b/Language/Haskell/GhcMod/Check.hs index 49da47c..08581eb 100644 --- a/Language/Haskell/GhcMod/Check.hs +++ b/Language/Haskell/GhcMod/Check.hs @@ -1,8 +1,8 @@ module Language.Haskell.GhcMod.Check (checkSyntax, check) where -import Control.Applicative -import Control.Monad -import CoreMonad +import Control.Applicative ((<$>)) +import Control.Monad (void) +import CoreMonad (liftIO) import Exception import GHC import Language.Haskell.GhcMod.ErrMsg diff --git a/Language/Haskell/GhcMod/Debug.hs b/Language/Haskell/GhcMod/Debug.hs index 09f9f58..9fa84f9 100644 --- a/Language/Haskell/GhcMod/Debug.hs +++ b/Language/Haskell/GhcMod/Debug.hs @@ -3,10 +3,10 @@ module Language.Haskell.GhcMod.Debug (debugInfo, debug, rootInfo, root) where import Control.Applicative import Control.Exception.IOChoice import Control.Monad +import CoreMonad (liftIO) import Data.List (intercalate) import Data.Maybe import GHC -import GhcMonad (liftIO) import Language.Haskell.GhcMod.CabalApi import Language.Haskell.GhcMod.GHCApi import Language.Haskell.GhcMod.Types diff --git a/Language/Haskell/GhcMod/GHCApi.hs b/Language/Haskell/GhcMod/GHCApi.hs index 99cb6ea..01d9e36 100644 --- a/Language/Haskell/GhcMod/GHCApi.hs +++ b/Language/Haskell/GhcMod/GHCApi.hs @@ -14,7 +14,7 @@ module Language.Haskell.GhcMod.GHCApi ( import Control.Applicative import Control.Exception import Control.Monad -import CoreMonad +import CoreMonad (liftIO) import Data.Maybe (isJust,fromJust) import Distribution.PackageDescription (PackageDescription) import DynFlags diff --git a/Language/Haskell/GhcMod/GHCChoice.hs b/Language/Haskell/GhcMod/GHCChoice.hs index 6f0677d..5747e50 100644 --- a/Language/Haskell/GhcMod/GHCChoice.hs +++ b/Language/Haskell/GhcMod/GHCChoice.hs @@ -3,7 +3,7 @@ module Language.Haskell.GhcMod.GHCChoice where import Control.Exception -import CoreMonad +import CoreMonad (liftIO) import Exception import GHC diff --git a/Language/Haskell/GhcMod/Gap.hs b/Language/Haskell/GhcMod/Gap.hs index dd285be..424913d 100644 --- a/Language/Haskell/GhcMod/Gap.hs +++ b/Language/Haskell/GhcMod/Gap.hs @@ -11,7 +11,6 @@ module Language.Haskell.GhcMod.Gap ( , setCtx , fOptions , toStringBuffer - , liftIO , showSeverityCaption , setCabalPkg , addDevPkgs @@ -69,10 +68,8 @@ import GHC hiding (ClsInst) import GHC hiding (Instance) #endif -#if __GLASGOW_HASKELL__ >= 702 +#if __GLASGOW_HASKELL__ < 702 import CoreMonad (liftIO) -#else -import HscTypes (liftIO) import Pretty #endif diff --git a/Language/Haskell/GhcMod/Info.hs b/Language/Haskell/GhcMod/Info.hs index 9fc93a6..9bd4e41 100644 --- a/Language/Haskell/GhcMod/Info.hs +++ b/Language/Haskell/GhcMod/Info.hs @@ -11,6 +11,7 @@ module Language.Haskell.GhcMod.Info ( import Control.Applicative ((<$>)) import Control.Monad (void) +import CoreMonad (liftIO) import CoreUtils (exprType) import Data.Function (on) import Data.Generics hiding (typeOf) @@ -65,7 +66,7 @@ info opt cradle file modstr expr = instance HasType (LHsExpr Id) where getType tcm e = do hs_env <- getSession - mbe <- Gap.liftIO $ Gap.deSugar tcm e hs_env + mbe <- liftIO $ Gap.deSugar tcm e hs_env return $ (getLoc e, ) <$> CoreUtils.exprType <$> mbe instance HasType (LPat Id) where @@ -156,7 +157,7 @@ inModuleContext _ opt cradle file modstr action errmsg = moddef = "module " ++ sanitize modstr ++ " where" header = moddef : imports importsBuf <- Gap.toStringBuffer header - clkTime <- Gap.liftIO getCurrentTime + clkTime <- liftIO getCurrentTime setTargets [Gap.mkTarget (TargetModule $ mkModuleName modstr) True (Just (importsBuf, clkTime))] diff --git a/src/GHCModi.hs b/src/GHCModi.hs index 16b834e..91b3bf7 100644 --- a/src/GHCModi.hs +++ b/src/GHCModi.hs @@ -16,6 +16,7 @@ import Control.Concurrent (forkIO, MVar, newEmptyMVar, putMVar, readMVar) import Control.Exception (SomeException(..)) import qualified Control.Exception as E import Control.Monad (when, void) +import CoreMonad (liftIO) import Data.Function (on) import Data.List (intercalate, groupBy, sort, find) #if MIN_VERSION_containers(0,5,0) @@ -30,7 +31,6 @@ import qualified Data.Set as S import qualified Exception as GE import GHC (Ghc, LoadHowMuch(LoadAllTargets), TargetId(TargetFile)) import qualified GHC as G -import GhcMonad (liftIO) import HscTypes (SourceError) import Language.Haskell.GhcMod import Language.Haskell.GhcMod.Internal