summaryrefslogtreecommitdiff
path: root/compiler/simplCore/CoreMonad.lhs
diff options
context:
space:
mode:
authorIan Lynagh <ian@well-typed.com>2012-11-02 14:47:38 +0000
committerIan Lynagh <ian@well-typed.com>2012-11-02 15:26:07 +0000
commitfb31191a76b0b623e11aab8486643bc175a8712e (patch)
tree3ceaa2bba59d6a32b5892e4a2cfaa53b0440ab87 /compiler/simplCore/CoreMonad.lhs
parent0a7c4efe8b7ce459979c0cb18d60910539347f9c (diff)
downloadhaskell-fb31191a76b0b623e11aab8486643bc175a8712e.tar.gz
Refactoring: Make a HasModule class for getModule
Diffstat (limited to 'compiler/simplCore/CoreMonad.lhs')
-rw-r--r--compiler/simplCore/CoreMonad.lhs8
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/simplCore/CoreMonad.lhs b/compiler/simplCore/CoreMonad.lhs
index bc1e1e5199..c2c265044c 100644
--- a/compiler/simplCore/CoreMonad.lhs
+++ b/compiler/simplCore/CoreMonad.lhs
@@ -72,7 +72,7 @@ import PprCore
import CoreUtils
import CoreLint ( lintCoreBindings )
import HscTypes
-import Module ( Module )
+import Module
import DynFlags
import StaticFlags
import Rules ( RuleBase )
@@ -863,9 +863,6 @@ getHscEnv = read cr_hsc_env
getRuleBase :: CoreM RuleBase
getRuleBase = read cr_rule_base
-getModule :: CoreM Module
-getModule = read cr_module
-
addSimplCount :: SimplCount -> CoreM ()
addSimplCount count = write (CoreWriter { cw_simpl_count = count })
@@ -874,6 +871,9 @@ addSimplCount count = write (CoreWriter { cw_simpl_count = count })
instance HasDynFlags CoreM where
getDynFlags = fmap hsc_dflags getHscEnv
+instance HasModule CoreM where
+ getModule = read cr_module
+
-- | The original name cache is the current mapping from 'Module' and
-- 'OccName' to a compiler-wide unique 'Name'
getOrigNameCache :: CoreM OrigNameCache