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

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