Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/d90176cff3e68abef581cedaa9848841f300fd3d

>---------------------------------------------------------------

commit d90176cff3e68abef581cedaa9848841f300fd3d
Author: Paolo Capriotti <[email protected]>
Date:   Thu Jul 12 17:49:41 2012 +0100

    Add MonadIO instance to SimplM.

>---------------------------------------------------------------

 compiler/simplCore/SimplMonad.lhs |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/compiler/simplCore/SimplMonad.lhs 
b/compiler/simplCore/SimplMonad.lhs
index 6883b6a..04b8c4e 100644
--- a/compiler/simplCore/SimplMonad.lhs
+++ b/compiler/simplCore/SimplMonad.lhs
@@ -35,6 +35,7 @@ import DynFlags
 import CoreMonad
 import Outputable
 import FastString
+import MonadUtils
 \end{code}
 
 %************************************************************************
@@ -153,6 +154,11 @@ instance MonadUnique SimplM where
 instance HasDynFlags SimplM where
     getDynFlags = SM (\st_env us sc -> return (st_flags st_env, us, sc))
 
+instance MonadIO SimplM where
+    liftIO m = SM $ \_ us sc -> do
+      x <- m
+      return (x, us, sc)
+
 getSimplRules :: SimplM RuleBase
 getSimplRules = SM (\st_env us sc -> return (st_rules st_env, us, sc))
 



_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to