diff options
author | Kavon Farvardin <kavon@farvard.in> | 2018-09-23 15:29:37 -0500 |
---|---|---|
committer | Kavon Farvardin <kavon@farvard.in> | 2018-09-23 15:29:37 -0500 |
commit | 84c2ad99582391005b5e873198b15e9e9eb4f78d (patch) | |
tree | caa8c2f2ec7e97fbb4977263c6817c9af5025cf4 /compiler/utils/IOEnv.hs | |
parent | 8ddb47cfcf5776e9a3c55fd37947c8a95e00fa12 (diff) | |
parent | e68b439fe5de61b9a2ca51af472185c62ccb8b46 (diff) | |
download | haskell-wip/T13904.tar.gz |
update to current master againwip/T13904
Diffstat (limited to 'compiler/utils/IOEnv.hs')
-rw-r--r-- | compiler/utils/IOEnv.hs | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/compiler/utils/IOEnv.hs b/compiler/utils/IOEnv.hs index 29854c51fe..4640b2b7c2 100644 --- a/compiler/utils/IOEnv.hs +++ b/compiler/utils/IOEnv.hs @@ -1,5 +1,3 @@ -{-# LANGUAGE CPP #-} - -- -- (c) The University of Glasgow 2002-2006 -- @@ -31,6 +29,8 @@ module IOEnv ( atomicUpdMutVar, atomicUpdMutVar' ) where +import GhcPrelude + import DynFlags import Exception import Module @@ -41,9 +41,7 @@ import Data.IORef ( IORef, newIORef, readIORef, writeIORef, modifyIORef, import System.IO.Unsafe ( unsafeInterleaveIO ) import System.IO ( fixIO ) import Control.Monad -#if __GLASGOW_HASKELL__ > 710 import qualified Control.Monad.Fail as MonadFail -#endif import MonadUtils import Control.Applicative (Alternative(..)) @@ -60,13 +58,10 @@ unIOEnv (IOEnv m) = m instance Monad (IOEnv m) where (>>=) = thenM (>>) = (*>) - fail _ = failM -- Ignore the string + fail = MonadFail.fail -#if __GLASGOW_HASKELL__ > 710 instance MonadFail.MonadFail (IOEnv m) where fail _ = failM -- Ignore the string -#endif - instance Applicative (IOEnv m) where pure = returnM @@ -111,7 +106,7 @@ instance ExceptionMonad (IOEnv a) where instance ContainsDynFlags env => HasDynFlags (IOEnv env) where getDynFlags = do env <- getEnv - return $ extractDynFlags env + return $! extractDynFlags env instance ContainsModule env => HasModule (IOEnv env) where getModule = do env <- getEnv |