[project @ 2002-04-26 13:34:05 by simonmar]
[ghc-base.git] / Control / Monad / Fix.hs
index a596f44..1122588 100644 (file)
@@ -1,5 +1,5 @@
 -----------------------------------------------------------------------------
--- 
+-- |
 -- Module      :  Control.Monad.Fix
 -- Copyright   :  (c) Andy Gill 2001,
 --               (c) Oregon Graduate Institute of Science and Technology, 2001
@@ -7,9 +7,7 @@
 -- 
 -- Maintainer  :  libraries@haskell.org
 -- Stability   :  experimental
--- Portability :  non-portable (reqruires multi-param type classes)
---
--- $Id: Fix.hs,v 1.1 2001/06/28 14:15:02 simonmar Exp $
+-- Portability :  portable
 --
 -- The Fix monad.
 --
@@ -29,10 +27,7 @@ module Control.Monad.Fix (
   ) where
 
 import Prelude
-
 import System.IO
-import Control.Monad.ST
-
 
 fix :: (a -> a) -> a
 fix f = let x = f x in x
@@ -40,16 +35,13 @@ fix f = let x = f x in x
 class (Monad m) => MonadFix m where
        mfix :: (a -> m a) -> m a
 
--- Perhaps these should live beside (the ST & IO) definition.
-instance MonadFix IO where
-       mfix = fixIO
-
-instance MonadFix (ST s) where
-       mfix = fixST
-
 instance MonadFix Maybe where
        mfix f = let
                a = f $ case a of
                        Just x -> x
                        _      -> error "empty mfix argument"
                in a
+
+instance MonadFix IO where
+       mfix = fixIO
+