close import.

This commit is contained in:
Kazu Yamamoto 2014-03-27 15:45:51 +09:00
parent c9429cfc97
commit f24749b13b

View File

@ -2,21 +2,21 @@
module Language.Haskell.GhcMod.GHCChoice where
import Control.Exception
import Control.Exception (IOException)
import CoreMonad (liftIO)
import Exception
import GHC
import qualified Exception as GE
import GHC (Ghc, GhcMonad)
----------------------------------------------------------------
-- | Try the left 'Ghc' action. If 'IOException' occurs, try
-- the right 'Ghc' action.
(||>) :: Ghc a -> Ghc a -> Ghc a
x ||> y = x `gcatch` (\(_ :: IOException) -> y)
x ||> y = x `GE.gcatch` (\(_ :: IOException) -> y)
-- | Go to the next 'Ghc' monad by throwing 'AltGhcgoNext'.
goNext :: Ghc a
goNext = liftIO . throwIO $ userError "goNext"
goNext = liftIO . GE.throwIO $ userError "goNext"
-- | Run any one 'Ghc' monad.
runAnyOne :: [Ghc a] -> Ghc a
@ -27,4 +27,4 @@ runAnyOne = foldr (||>) goNext
-- | Try the left 'GhcMonad' action. If 'IOException' occurs, try
-- the right 'GhcMonad' action.
(|||>) :: GhcMonad m => m a -> m a -> m a
x |||> y = x `gcatch` (\(_ :: IOException) -> y)
x |||> y = x `GE.gcatch` (\(_ :: IOException) -> y)