using liftIO from CoreMonad.

This commit is contained in:
Kazu Yamamoto 2014-03-27 15:08:07 +09:00
parent 07ec988251
commit 660a1e95f5
7 changed files with 11 additions and 13 deletions

View File

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

View File

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

View File

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

View File

@ -3,7 +3,7 @@
module Language.Haskell.GhcMod.GHCChoice where
import Control.Exception
import CoreMonad
import CoreMonad (liftIO)
import Exception
import GHC

View File

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

View File

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

View File

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