• Zejun Wu's avatar
    Introduce GhciMonad and generalize types of functions in GHCi.UI · e08974e8
    Zejun Wu authored
    Introduce `GhciMonad`, which is bascially `GhcMonad` + `HasGhciState`.
    Generalize the commands and help functions defined in `GHCi.UI` so they
    can be used as both `GHCi a` and `InputT GHCi a`.
    The long term plan is to move reusable bits to ghci library and make it
    easier to build a customized interactive ui which carries customized state
    and provides customized commands.
    Most changes are trivial in this diff by relaxing the type constraint or
    add/remove lift as necessary. The non-trivial changes are:
    * Change `HasGhciState` to `GhciMonad` and expose it.
    * Implementation of `reifyGHCi`.
    Test Plan:
    Reviewers: simonmar, hvr, bgamari
    Reviewed By: simonmar
    Subscribers: rwbarton, carter
    Differential Revision: https://phabricator.haskell.org/D5433
UI.hs 157 KB