close import.
This commit is contained in:
parent
c9429cfc97
commit
f24749b13b
@ -2,21 +2,21 @@
|
|||||||
|
|
||||||
module Language.Haskell.GhcMod.GHCChoice where
|
module Language.Haskell.GhcMod.GHCChoice where
|
||||||
|
|
||||||
import Control.Exception
|
import Control.Exception (IOException)
|
||||||
import CoreMonad (liftIO)
|
import CoreMonad (liftIO)
|
||||||
import Exception
|
import qualified Exception as GE
|
||||||
import GHC
|
import GHC (Ghc, GhcMonad)
|
||||||
|
|
||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
|
|
||||||
-- | Try the left 'Ghc' action. If 'IOException' occurs, try
|
-- | Try the left 'Ghc' action. If 'IOException' occurs, try
|
||||||
-- the right 'Ghc' action.
|
-- the right 'Ghc' action.
|
||||||
(||>) :: Ghc a -> Ghc a -> Ghc a
|
(||>) :: 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'.
|
-- | Go to the next 'Ghc' monad by throwing 'AltGhcgoNext'.
|
||||||
goNext :: Ghc a
|
goNext :: Ghc a
|
||||||
goNext = liftIO . throwIO $ userError "goNext"
|
goNext = liftIO . GE.throwIO $ userError "goNext"
|
||||||
|
|
||||||
-- | Run any one 'Ghc' monad.
|
-- | Run any one 'Ghc' monad.
|
||||||
runAnyOne :: [Ghc a] -> Ghc a
|
runAnyOne :: [Ghc a] -> Ghc a
|
||||||
@ -27,4 +27,4 @@ runAnyOne = foldr (||>) goNext
|
|||||||
-- | Try the left 'GhcMonad' action. If 'IOException' occurs, try
|
-- | Try the left 'GhcMonad' action. If 'IOException' occurs, try
|
||||||
-- the right 'GhcMonad' action.
|
-- the right 'GhcMonad' action.
|
||||||
(|||>) :: GhcMonad m => m a -> m a -> m a
|
(|||>) :: GhcMonad m => m a -> m a -> m a
|
||||||
x |||> y = x `gcatch` (\(_ :: IOException) -> y)
|
x |||> y = x `GE.gcatch` (\(_ :: IOException) -> y)
|
||||||
|
Loading…
Reference in New Issue
Block a user