Introduce HasGhciState class and refactor use-sites
authorHerbert Valerio Riedel <hvr@gnu.org>
Tue, 8 Dec 2015 07:48:21 +0000 (08:48 +0100)
committerHerbert Valerio Riedel <hvr@gnu.org>
Tue, 8 Dec 2015 08:17:02 +0000 (09:17 +0100)
commit2f6e87a494330837c425dab67ba26ee36bd9eacf
tree5bb56e6419cd6f5a3528e6106ee97cb151cabbcc
parent834f9a46a7493e88c41ac01210bc3fcde7a2c0f9
Introduce HasGhciState class and refactor use-sites

This allows to reach the GhciState without having to keep
track how many Monad transformer layers sit on top of the
GHCi monad.

While at it, this also refactors code to make more use of the
existing `modifyGHCiState` operation.

This is a preparatory refactoring for #10874

Differential Revision: https://phabricator.haskell.org/D1582
ghc/GhciMonad.hs
ghc/InteractiveUI.hs