diff options
| author | John Ericson <John.Ericson@Obsidian.Systems> | 2022-06-15 21:44:08 +0000 |
|---|---|---|
| committer | John Ericson <John.Ericson@Obsidian.Systems> | 2022-07-27 04:55:12 +0000 |
| commit | 3767fc823bf2827bab5a972b3d05017bc65e25b3 (patch) | |
| tree | a6342bbb6982fc0133557bb6c633a4ade2e15e19 /compiler/GHC/Driver/Monad | |
| parent | b154ec781a8f7cf84aa2e415a09e222c60bcd285 (diff) | |
| download | haskell-wip/rip-out-interactive-context.tar.gz | |
WIP: remove `InteractiveContext` from `HscEnv`wip/rip-out-interactive-context
GHC the library typechecks!
Diffstat (limited to 'compiler/GHC/Driver/Monad')
| -rw-r--r-- | compiler/GHC/Driver/Monad/Interactive.hs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/compiler/GHC/Driver/Monad/Interactive.hs b/compiler/GHC/Driver/Monad/Interactive.hs new file mode 100644 index 0000000000..b37a612a83 --- /dev/null +++ b/compiler/GHC/Driver/Monad/Interactive.hs @@ -0,0 +1,21 @@ +module GHC.Driver.Monad.Interactive where + +import GHC.Prelude + +import GHC.Driver.Monad ( GhcMonad ) +import GHC.Runtime.Context ( InteractiveContext ) + +class GhcMonad m => GhciMonad m where + getInteractiveContext :: m InteractiveContext + + setInteractiveContext :: InteractiveContext -> m () + + modifyInteractiveContext :: (InteractiveContext -> InteractiveContext) -> m () + modifyInteractiveContext f = do + m <- getInteractiveContext + setInteractiveContext $ f m + +modifyInteractiveContextM :: GhciMonad m => (InteractiveContext -> m InteractiveContext) -> m () +modifyInteractiveContextM f = do + m <- getInteractiveContext + setInteractiveContext =<< f m |
