using liftIO from CoreMonad.
This commit is contained in:
parent
07ec988251
commit
660a1e95f5
@ -1,8 +1,8 @@
|
|||||||
module Language.Haskell.GhcMod.Check (checkSyntax, check) where
|
module Language.Haskell.GhcMod.Check (checkSyntax, check) where
|
||||||
|
|
||||||
import Control.Applicative
|
import Control.Applicative ((<$>))
|
||||||
import Control.Monad
|
import Control.Monad (void)
|
||||||
import CoreMonad
|
import CoreMonad (liftIO)
|
||||||
import Exception
|
import Exception
|
||||||
import GHC
|
import GHC
|
||||||
import Language.Haskell.GhcMod.ErrMsg
|
import Language.Haskell.GhcMod.ErrMsg
|
||||||
|
@ -3,10 +3,10 @@ module Language.Haskell.GhcMod.Debug (debugInfo, debug, rootInfo, root) where
|
|||||||
import Control.Applicative
|
import Control.Applicative
|
||||||
import Control.Exception.IOChoice
|
import Control.Exception.IOChoice
|
||||||
import Control.Monad
|
import Control.Monad
|
||||||
|
import CoreMonad (liftIO)
|
||||||
import Data.List (intercalate)
|
import Data.List (intercalate)
|
||||||
import Data.Maybe
|
import Data.Maybe
|
||||||
import GHC
|
import GHC
|
||||||
import GhcMonad (liftIO)
|
|
||||||
import Language.Haskell.GhcMod.CabalApi
|
import Language.Haskell.GhcMod.CabalApi
|
||||||
import Language.Haskell.GhcMod.GHCApi
|
import Language.Haskell.GhcMod.GHCApi
|
||||||
import Language.Haskell.GhcMod.Types
|
import Language.Haskell.GhcMod.Types
|
||||||
|
@ -14,7 +14,7 @@ module Language.Haskell.GhcMod.GHCApi (
|
|||||||
import Control.Applicative
|
import Control.Applicative
|
||||||
import Control.Exception
|
import Control.Exception
|
||||||
import Control.Monad
|
import Control.Monad
|
||||||
import CoreMonad
|
import CoreMonad (liftIO)
|
||||||
import Data.Maybe (isJust,fromJust)
|
import Data.Maybe (isJust,fromJust)
|
||||||
import Distribution.PackageDescription (PackageDescription)
|
import Distribution.PackageDescription (PackageDescription)
|
||||||
import DynFlags
|
import DynFlags
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
module Language.Haskell.GhcMod.GHCChoice where
|
module Language.Haskell.GhcMod.GHCChoice where
|
||||||
|
|
||||||
import Control.Exception
|
import Control.Exception
|
||||||
import CoreMonad
|
import CoreMonad (liftIO)
|
||||||
import Exception
|
import Exception
|
||||||
import GHC
|
import GHC
|
||||||
|
|
||||||
|
@ -11,7 +11,6 @@ module Language.Haskell.GhcMod.Gap (
|
|||||||
, setCtx
|
, setCtx
|
||||||
, fOptions
|
, fOptions
|
||||||
, toStringBuffer
|
, toStringBuffer
|
||||||
, liftIO
|
|
||||||
, showSeverityCaption
|
, showSeverityCaption
|
||||||
, setCabalPkg
|
, setCabalPkg
|
||||||
, addDevPkgs
|
, addDevPkgs
|
||||||
@ -69,10 +68,8 @@ import GHC hiding (ClsInst)
|
|||||||
import GHC hiding (Instance)
|
import GHC hiding (Instance)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if __GLASGOW_HASKELL__ >= 702
|
#if __GLASGOW_HASKELL__ < 702
|
||||||
import CoreMonad (liftIO)
|
import CoreMonad (liftIO)
|
||||||
#else
|
|
||||||
import HscTypes (liftIO)
|
|
||||||
import Pretty
|
import Pretty
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@ module Language.Haskell.GhcMod.Info (
|
|||||||
|
|
||||||
import Control.Applicative ((<$>))
|
import Control.Applicative ((<$>))
|
||||||
import Control.Monad (void)
|
import Control.Monad (void)
|
||||||
|
import CoreMonad (liftIO)
|
||||||
import CoreUtils (exprType)
|
import CoreUtils (exprType)
|
||||||
import Data.Function (on)
|
import Data.Function (on)
|
||||||
import Data.Generics hiding (typeOf)
|
import Data.Generics hiding (typeOf)
|
||||||
@ -65,7 +66,7 @@ info opt cradle file modstr expr =
|
|||||||
instance HasType (LHsExpr Id) where
|
instance HasType (LHsExpr Id) where
|
||||||
getType tcm e = do
|
getType tcm e = do
|
||||||
hs_env <- getSession
|
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
|
return $ (getLoc e, ) <$> CoreUtils.exprType <$> mbe
|
||||||
|
|
||||||
instance HasType (LPat Id) where
|
instance HasType (LPat Id) where
|
||||||
@ -156,7 +157,7 @@ inModuleContext _ opt cradle file modstr action errmsg =
|
|||||||
moddef = "module " ++ sanitize modstr ++ " where"
|
moddef = "module " ++ sanitize modstr ++ " where"
|
||||||
header = moddef : imports
|
header = moddef : imports
|
||||||
importsBuf <- Gap.toStringBuffer header
|
importsBuf <- Gap.toStringBuffer header
|
||||||
clkTime <- Gap.liftIO getCurrentTime
|
clkTime <- liftIO getCurrentTime
|
||||||
setTargets [Gap.mkTarget (TargetModule $ mkModuleName modstr)
|
setTargets [Gap.mkTarget (TargetModule $ mkModuleName modstr)
|
||||||
True
|
True
|
||||||
(Just (importsBuf, clkTime))]
|
(Just (importsBuf, clkTime))]
|
||||||
|
@ -16,6 +16,7 @@ import Control.Concurrent (forkIO, MVar, newEmptyMVar, putMVar, readMVar)
|
|||||||
import Control.Exception (SomeException(..))
|
import Control.Exception (SomeException(..))
|
||||||
import qualified Control.Exception as E
|
import qualified Control.Exception as E
|
||||||
import Control.Monad (when, void)
|
import Control.Monad (when, void)
|
||||||
|
import CoreMonad (liftIO)
|
||||||
import Data.Function (on)
|
import Data.Function (on)
|
||||||
import Data.List (intercalate, groupBy, sort, find)
|
import Data.List (intercalate, groupBy, sort, find)
|
||||||
#if MIN_VERSION_containers(0,5,0)
|
#if MIN_VERSION_containers(0,5,0)
|
||||||
@ -30,7 +31,6 @@ import qualified Data.Set as S
|
|||||||
import qualified Exception as GE
|
import qualified Exception as GE
|
||||||
import GHC (Ghc, LoadHowMuch(LoadAllTargets), TargetId(TargetFile))
|
import GHC (Ghc, LoadHowMuch(LoadAllTargets), TargetId(TargetFile))
|
||||||
import qualified GHC as G
|
import qualified GHC as G
|
||||||
import GhcMonad (liftIO)
|
|
||||||
import HscTypes (SourceError)
|
import HscTypes (SourceError)
|
||||||
import Language.Haskell.GhcMod
|
import Language.Haskell.GhcMod
|
||||||
import Language.Haskell.GhcMod.Internal
|
import Language.Haskell.GhcMod.Internal
|
||||||
|
Loading…
Reference in New Issue
Block a user