summaryrefslogtreecommitdiff
path: root/compiler/utils/IOEnv.hs
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/utils/IOEnv.hs
parent0a7c4efe8b7ce459979c0cb18d60910539347f9c (diff)
downloadhaskell-fb31191a76b0b623e11aab8486643bc175a8712e.tar.gz
Refactoring: Make a HasModule class for getModule
Diffstat (limited to 'compiler/utils/IOEnv.hs')
-rw-r--r--compiler/utils/IOEnv.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/utils/IOEnv.hs b/compiler/utils/IOEnv.hs
index ee7e616305..35d7973c04 100644
--- a/compiler/utils/IOEnv.hs
+++ b/compiler/utils/IOEnv.hs
@@ -32,6 +32,7 @@ module IOEnv (
import DynFlags
import Exception
+import Module
import Panic
import Data.IORef ( IORef, newIORef, readIORef, writeIORef, modifyIORef,
@@ -93,6 +94,10 @@ instance ContainsDynFlags env => HasDynFlags (IOEnv env) where
getDynFlags = do env <- getEnv
return $ extractDynFlags env
+instance ContainsModule env => HasModule (IOEnv env) where
+ getModule = do env <- getEnv
+ return $ extractModule env
+
----------------------------------------------------------------------
-- Fundmantal combinators specific to the monad
----------------------------------------------------------------------