docs
This commit is contained in:
parent
33e9751390
commit
0974eec9a5
@ -113,11 +113,13 @@ instance (MonadIO m, MonadBaseControl IO m) => GhcMonad (GmlT m) where
|
|||||||
getSession = gmlGetSession
|
getSession = gmlGetSession
|
||||||
setSession = gmlSetSession
|
setSession = gmlSetSession
|
||||||
|
|
||||||
|
-- | Get the underlying GHC session
|
||||||
gmlGetSession :: (MonadIO m, MonadBaseControl IO m) => GmlT m HscEnv
|
gmlGetSession :: (MonadIO m, MonadBaseControl IO m) => GmlT m HscEnv
|
||||||
gmlGetSession = do
|
gmlGetSession = do
|
||||||
ref <- gmgsSession . fromJust . gmGhcSession <$> gmsGet
|
ref <- gmgsSession . fromJust . gmGhcSession <$> gmsGet
|
||||||
liftIO $ readIORef ref
|
liftIO $ readIORef ref
|
||||||
|
|
||||||
|
-- | Set the underlying GHC session
|
||||||
gmlSetSession :: (MonadIO m, MonadBaseControl IO m) => HscEnv -> GmlT m ()
|
gmlSetSession :: (MonadIO m, MonadBaseControl IO m) => HscEnv -> GmlT m ()
|
||||||
gmlSetSession a = do
|
gmlSetSession a = do
|
||||||
ref <- gmgsSession . fromJust . gmGhcSession <$> gmsGet
|
ref <- gmgsSession . fromJust . gmGhcSession <$> gmsGet
|
||||||
|
@ -104,10 +104,13 @@ dropSession = do
|
|||||||
|
|
||||||
Nothing -> return ()
|
Nothing -> return ()
|
||||||
|
|
||||||
|
-- | Run a GmlT action (i.e. a function in the GhcMonad) in the context
|
||||||
|
-- of certain files or modules
|
||||||
runGmlT :: IOish m => [Either FilePath ModuleName] -> GmlT m a -> GhcModT m a
|
runGmlT :: IOish m => [Either FilePath ModuleName] -> GmlT m a -> GhcModT m a
|
||||||
runGmlT fns action = runGmlT' fns return action
|
runGmlT fns action = runGmlT' fns return action
|
||||||
|
|
||||||
|
-- | Run a GmlT action (i.e. a function in the GhcMonad) in the context
|
||||||
|
-- of certain files or modules, with updated GHC flags
|
||||||
runGmlT' :: IOish m
|
runGmlT' :: IOish m
|
||||||
=> [Either FilePath ModuleName]
|
=> [Either FilePath ModuleName]
|
||||||
-> (DynFlags -> Ghc DynFlags)
|
-> (DynFlags -> Ghc DynFlags)
|
||||||
@ -115,6 +118,9 @@ runGmlT' :: IOish m
|
|||||||
-> GhcModT m a
|
-> GhcModT m a
|
||||||
runGmlT' fns mdf action = runGmlTWith fns mdf id action
|
runGmlT' fns mdf action = runGmlTWith fns mdf id action
|
||||||
|
|
||||||
|
-- | Run a GmlT action (i.e. a function in the GhcMonad) in the context
|
||||||
|
-- of certain files or modules, with updated GHC flags and a final
|
||||||
|
-- transformation
|
||||||
runGmlTWith :: IOish m
|
runGmlTWith :: IOish m
|
||||||
=> [Either FilePath ModuleName]
|
=> [Either FilePath ModuleName]
|
||||||
-> (DynFlags -> Ghc DynFlags)
|
-> (DynFlags -> Ghc DynFlags)
|
||||||
|
Loading…
Reference in New Issue
Block a user