projects
/
ghc-base.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use explicit language extensions & remove extension fields from base.cabal
[ghc-base.git]
/
Control
/
Monad
/
ST.hs
diff --git
a/Control/Monad/ST.hs
b/Control/Monad/ST.hs
index
b779664
..
397b072
100644
(file)
--- a/
Control/Monad/ST.hs
+++ b/
Control/Monad/ST.hs
@@
-1,4
+1,5
@@
-{-# OPTIONS_GHC -fno-warn-orphans #-}
+{-# LANGUAGE CPP #-}
+
-----------------------------------------------------------------------------
-- |
-- Module : Control.Monad.ST
-----------------------------------------------------------------------------
-- |
-- Module : Control.Monad.ST
@@
-32,17
+33,25
@@
module Control.Monad.ST
unsafeSTToIO -- :: ST s a -> IO a
) where
unsafeSTToIO -- :: ST s a -> IO a
) where
-import Prelude
-
+#if defined(__GLASGOW_HASKELL__)
+import Control.Monad.Fix ()
+#else
import Control.Monad.Fix
import Control.Monad.Fix
+#endif
#include "Typeable.h"
#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
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")
INSTANCE_TYPEABLE2(ST,sTTc,"ST")
INSTANCE_TYPEABLE0(RealWorld,realWorldTc,"RealWorld")
@@
-54,12
+63,8
@@
unsafeInterleaveST =
LazyST.lazyToStrictST . LazyST.unsafeInterleaveST . LazyST.strictToLazyST
#endif
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
instance MonadFix (ST s) where
mfix = fixST
+#endif