Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move ExceptionMonad instance lift to ghc-mod #54

Open
wants to merge 1 commit into
base: ghc-8.4
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions src/Language/Haskell/Refact/Utils/Monad.hs
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@ import System.Log.Logger
import qualified Data.Map as Map
import qualified Data.Set as Set

-- Monad transformer stuff
import Control.Monad.Trans.Control ( control, liftBaseOp, liftBaseOp_)

-- ---------------------------------------------------------------------

data VerboseLevel = Debug | Normal | Off
Expand Down Expand Up @@ -244,15 +241,6 @@ instance GHC.HasDynFlags RefactGhc where

-- ---------------------------------------------------------------------

instance ExceptionMonad (StateT RefactState IO) where
gcatch act handler = control $ \run ->
run act `gcatch` (run . handler)

gmask = liftBaseOp gmask . liftRestore
where liftRestore f r = f $ liftBaseOp_ r

-- ---------------------------------------------------------------------

cabalModuleGraphs :: RefactGhc [GM.GmModuleGraph]
cabalModuleGraphs = RefactGhc doCabalModuleGraphs
where
Expand Down