X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Futils%2FIOEnv.hs;h=b81b2e8fde943c30e710b257a686d76e5c11f070;hb=d436c70d43fb905c63220040168295e473f4b90a;hp=5f354f0e4d96ee84d14bce08271b1b3cc4d8008c;hpb=2b670a7983da26c0f186d5ebdf195e47a39ee60e;p=ghc-hetmet.git diff --git a/compiler/utils/IOEnv.hs b/compiler/utils/IOEnv.hs index 5f354f0..b81b2e8 100644 --- a/compiler/utils/IOEnv.hs +++ b/compiler/utils/IOEnv.hs @@ -66,7 +66,7 @@ thenM (IOEnv m) f = IOEnv (\ env -> do { r <- m env ; unIOEnv (f r) env }) thenM_ :: IOEnv env a -> IOEnv env b -> IOEnv env b -thenM_ (IOEnv m) f = IOEnv (\ env -> do { m env ; unIOEnv f env }) +thenM_ (IOEnv m) f = IOEnv (\ env -> do { _ <- m env ; unIOEnv f env }) failM :: IOEnv env a failM = IOEnv (\ _ -> throwIO IOEnvFailure) @@ -139,15 +139,9 @@ unsafeInterleaveM (IOEnv m) = IOEnv (\ env -> unsafeInterleaveIO (m env)) -- For use if the user has imported Control.Monad.Error from MTL -- Requires UndecidableInstances -#if __GLASGOW_HASKELL__ > 606 --- for some reason, this doesn't compile with GHC 6.6: --- utils/IOEnv.hs:144:33: --- No instance for (MonadPlus IO) --- arising from use of `mplus' at utils/IOEnv.hs:144:33-67 instance MonadPlus IO => MonadPlus (IOEnv env) where mzero = IOEnv (const mzero) m `mplus` n = IOEnv (\env -> unIOEnv m env `mplus` unIOEnv n env) -#endif ---------------------------------------------------------------------- -- Accessing input/output