diff options
| author | Paolo Capriotti <p.capriotti@gmail.com> | 2012-07-12 17:49:41 +0100 |
|---|---|---|
| committer | Paolo Capriotti <p.capriotti@gmail.com> | 2012-07-13 08:25:36 +0100 |
| commit | d90176cff3e68abef581cedaa9848841f300fd3d (patch) | |
| tree | 34d02a2a77bd1629e6466c11dc059c59118a7b2e /compiler | |
| parent | 9bf764becbedfdef5d56c1d7bc541c0868b36f66 (diff) | |
| download | haskell-d90176cff3e68abef581cedaa9848841f300fd3d.tar.gz | |
Add MonadIO instance to SimplM.
Diffstat (limited to 'compiler')
| -rw-r--r-- | 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 6883b6acde..04b8c4e6d5 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)) |
