Use explicit language extensions & remove extension fields from base.cabal
[ghc-base.git] / Control / Monad / ST.hs
index b779664..397b072 100644 (file)
@@ -1,4 +1,5 @@
-{-# OPTIONS_GHC -fno-warn-orphans #-}
+{-# LANGUAGE CPP #-}
+
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  Control.Monad.ST
@@ -32,17 +33,25 @@ module Control.Monad.ST
         unsafeSTToIO            -- :: ST s a -> IO a
       ) where
 
-import Prelude
-
+#if defined(__GLASGOW_HASKELL__)
+import Control.Monad.Fix ()
+#else
 import Control.Monad.Fix
+#endif
 
 #include "Typeable.h"
 
-#ifdef __HUGS__
+#if defined(__GLASGOW_HASKELL__)
+import GHC.ST           ( ST, runST, fixST, unsafeInterleaveST )
+import GHC.Base         ( RealWorld )
+import GHC.IO           ( stToIO, unsafeIOToST, unsafeSTToIO )
+#elif defined(__HUGS__)
 import Data.Typeable
 import Hugs.ST
 import qualified Hugs.LazyST as LazyST
+#endif
 
+#if defined(__HUGS__)
 INSTANCE_TYPEABLE2(ST,sTTc,"ST")
 INSTANCE_TYPEABLE0(RealWorld,realWorldTc,"RealWorld")
 
@@ -54,12 +63,8 @@ unsafeInterleaveST =
     LazyST.lazyToStrictST . LazyST.unsafeInterleaveST . LazyST.strictToLazyST
 #endif
 
-#ifdef __GLASGOW_HASKELL__
-import GHC.ST           ( ST, runST, fixST, unsafeInterleaveST )
-import GHC.Base         ( RealWorld )
-import GHC.IOBase       ( stToIO, unsafeIOToST, unsafeSTToIO )
-#endif
-
+#if !defined(__GLASGOW_HASKELL__)
 instance MonadFix (ST s) where
         mfix = fixST
+#endif