Commit 893a3c0a authored by Ian Lynagh's avatar Ian Lynagh

Remove legacy code that isn't used now that we require GHC >= 6.8

parent de8c33e4
......@@ -31,13 +31,7 @@ import FastTypes
import MonadUtils
import Control.Monad
import Control.Monad.Fix
#if __GLASGOW_HASKELL__ >= 607
import GHC.IOBase (unsafeDupableInterleaveIO)
#else
import System.IO.Unsafe ( unsafeInterleaveIO )
unsafeDupableInterleaveIO :: IO a -> IO a
unsafeDupableInterleaveIO = unsafeInterleaveIO
#endif
\end{code}
......
......@@ -125,12 +125,9 @@ instance Applicative CoreM where
-- For use if the user has imported Control.Monad.Error from MTL
-- Requires UndecidableInstances
#if __GLASGOW_HASKELL__ > 606
-- see instance MonadPlus IOEnv
instance MonadPlus IO => MonadPlus CoreM where
mzero = CoreM (const mzero)
m `mplus` n = CoreM (\rs -> unCoreM m rs `mplus` unCoreM n rs)
#endif
instance MonadUnique CoreM where
getUniqueSupplyM = do
......
......@@ -23,17 +23,9 @@ import System.IO.Unsafe
import GHC.Exts
import GHC.Word
import GHC.IOBase (IO(..))
--why not import it at __GLASGOW_HASKELL__==606 ?
#if __GLASGOW_HASKELL__ >= 607
import GHC.IOBase (unsafeDupableInterleaveIO)
#endif
import GHC.Base (unsafeChr)
#if __GLASGOW_HASKELL__ < 607
unsafeDupableInterleaveIO :: IO a -> IO a
unsafeDupableInterleaveIO = unsafeInterleaveIO
#endif
-- Just like unsafePerformIO, but we inline it.
{-# INLINE inlinePerformIO #-}
inlinePerformIO :: IO a -> a
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment