Replace fromJust with fromJustNote everywhere
This commit is contained in:
@@ -73,6 +73,8 @@ import Language.Haskell.GhcMod.Monad.Out
|
||||
import Language.Haskell.GhcMod.Monad.Newtypes
|
||||
import Language.Haskell.GhcMod.Monad.Orphans ()
|
||||
|
||||
import Safe
|
||||
|
||||
import GHC
|
||||
import DynFlags
|
||||
import Exception
|
||||
@@ -116,13 +118,13 @@ instance (MonadIO m, MonadBaseControl IO m) => GhcMonad (GmlT m) where
|
||||
-- | Get the underlying GHC session
|
||||
gmlGetSession :: (MonadIO m, MonadBaseControl IO m) => GmlT m HscEnv
|
||||
gmlGetSession = do
|
||||
ref <- gmgsSession . fromJust . gmGhcSession <$> gmsGet
|
||||
ref <- gmgsSession . fromJustNote "gmlGetSession" . gmGhcSession <$> gmsGet
|
||||
liftIO $ readIORef ref
|
||||
|
||||
-- | Set the underlying GHC session
|
||||
gmlSetSession :: (MonadIO m, MonadBaseControl IO m) => HscEnv -> GmlT m ()
|
||||
gmlSetSession a = do
|
||||
ref <- gmgsSession . fromJust . gmGhcSession <$> gmsGet
|
||||
ref <- gmgsSession . fromJustNote "gmlSetSession" . gmGhcSession <$> gmsGet
|
||||
liftIO $ flip writeIORef a ref
|
||||
|
||||
instance GhcMonad LightGhc where
|
||||
|
||||
Reference in New Issue
Block a user