#ifdef __HUGS__
import Hugs.Prelude (MonadFix(mfix))
#endif
+#if defined(__GLASGOW_HASKELL__)
+import GHC.ST
+#endif
#ifndef __HUGS__
-- | Monads having fixed points with a \'knot-tying\' semantics.
instance MonadFix ((->) r) where
mfix f = \ r -> let a = f a r in a
+
+#if defined(__GLASGOW_HASKELL__)
+instance MonadFix (ST s) where
+ mfix = fixST
+#endif
+
-{-# OPTIONS_GHC -fno-warn-orphans #-}
-----------------------------------------------------------------------------
-- |
-- Module : Control.Monad.ST
unsafeSTToIO -- :: ST s a -> IO a
) where
+#if defined(__GLASGOW_HASKELL__)
+import Control.Monad.Fix ()
+#else
import Control.Monad.Fix
+#endif
#include "Typeable.h"
LazyST.lazyToStrictST . LazyST.unsafeInterleaveST . LazyST.strictToLazyST
#endif
+#if !defined(__GLASGOW_HASKELL__)
instance MonadFix (ST s) where
mfix = fixST
+#endif