Merge pull request #324 from DanielG/dev-conv
Remove `toGhcModT` it's not needed anymore.
This commit is contained in:
commit
6fec1de4b3
@ -36,8 +36,6 @@ module Language.Haskell.GhcMod.Internal (
|
|||||||
-- * Monad utilities
|
-- * Monad utilities
|
||||||
, runGhcModT'
|
, runGhcModT'
|
||||||
, withErrorHandler
|
, withErrorHandler
|
||||||
-- ** Conversion
|
|
||||||
, toGhcModT
|
|
||||||
-- ** Accessing 'GhcModEnv' and 'GhcModState'
|
-- ** Accessing 'GhcModEnv' and 'GhcModState'
|
||||||
, options
|
, options
|
||||||
, cradle
|
, cradle
|
||||||
|
@ -125,7 +125,7 @@ withLoggerTwice setDF1 body1 setDF2 body2 = do
|
|||||||
Right <$> readAndClearLogBagRef logref
|
Right <$> readAndClearLogBagRef logref
|
||||||
-- Merge errors and warnings
|
-- Merge errors and warnings
|
||||||
dflags <- G.getSessionDynFlags
|
dflags <- G.getSessionDynFlags
|
||||||
style <- toGhcModT getStyle
|
style <- getStyle
|
||||||
case (err1, err2) of
|
case (err1, err2) of
|
||||||
(Right b1, Right b2) -> do let (warn1,warn2) = mergeErrors dflags style b1 b2
|
(Right b1, Right b2) -> do let (warn1,warn2) = mergeErrors dflags style b1 b2
|
||||||
errAndWarnBagToStr Right emptyBag (warn1 `unionBags` b2)
|
errAndWarnBagToStr Right emptyBag (warn1 `unionBags` b2)
|
||||||
@ -150,7 +150,7 @@ errBagToStr = errBagToStr' Left
|
|||||||
errBagToStr' :: IOish m => (String -> a) -> Bag ErrMsg -> GhcModT m a
|
errBagToStr' :: IOish m => (String -> a) -> Bag ErrMsg -> GhcModT m a
|
||||||
errBagToStr' f err = do
|
errBagToStr' f err = do
|
||||||
dflags <- G.getSessionDynFlags
|
dflags <- G.getSessionDynFlags
|
||||||
style <- toGhcModT getStyle
|
style <- getStyle
|
||||||
ret <- convert' (errBagToStrList dflags style err)
|
ret <- convert' (errBagToStrList dflags style err)
|
||||||
return $ f ret
|
return $ f ret
|
||||||
|
|
||||||
|
@ -19,8 +19,6 @@ module Language.Haskell.GhcMod.Monad (
|
|||||||
, runGhcModT
|
, runGhcModT
|
||||||
, runGhcModT'
|
, runGhcModT'
|
||||||
, withErrorHandler
|
, withErrorHandler
|
||||||
-- ** Conversion
|
|
||||||
, toGhcModT
|
|
||||||
-- ** Accessing 'GhcModEnv' and 'GhcModState'
|
-- ** Accessing 'GhcModEnv' and 'GhcModState'
|
||||||
, gmsGet
|
, gmsGet
|
||||||
, gmsPut
|
, gmsPut
|
||||||
@ -306,12 +304,6 @@ overrideGhcUserOptions action = withTempSession $ do
|
|||||||
|
|
||||||
action ghcOpts
|
action ghcOpts
|
||||||
|
|
||||||
-- | This is only a transitional mechanism don't use it for new code.
|
|
||||||
toGhcModT :: IOish m => Ghc a -> GhcModT m a
|
|
||||||
toGhcModT a = do
|
|
||||||
s <- gmGhcSession <$> ask
|
|
||||||
liftIO $ unGhc a $ Session s
|
|
||||||
|
|
||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
|
|
||||||
gmsGet :: IOish m => GhcModT m GhcModState
|
gmsGet :: IOish m => GhcModT m GhcModState
|
||||||
|
Loading…
Reference in New Issue
Block a user