import Prelude
import System.IO
+import Control.Monad.Instances ()
-- | @'fix' f@ is the least fixed point of the function @f@,
-- i.e. the least defined @x@ such that @f x = x@.
-- IO:
instance MonadFix IO where
mfix = fixIO
+
+instance MonadFix ((->) r) where
+ mfix f = \ r -> let a = f a r in a