Add {-# OPTIONS_GHC -w #-} and some blurb to all compiler modules
[ghc-hetmet.git] / compiler / deSugar / DsMonad.lhs
index 577a0d8..4af6f68 100644 (file)
@@ -6,6 +6,13 @@
 @DsMonad@: monadery used in desugaring
 
 \begin{code}
+{-# OPTIONS_GHC -w #-}
+-- The above warning supression flag is a temporary kludge.
+-- While working on this module you are encouraged to remove it and fix
+-- any warnings in the module. See
+--     http://hackage.haskell.org/trac/ghc/wiki/WorkingConventions#Warnings
+-- for details
+
 module DsMonad (
        DsM, mappM, mapAndUnzipM,
        initDs, initDsTc, returnDs, thenDs, listDs, fixDs, mapAndUnzipDs, 
@@ -20,6 +27,7 @@ module DsMonad (
        UniqSupply, newUniqueSupply,
        getDOptsDs, getGhcModeDs, doptDs,
        dsLookupGlobal, dsLookupGlobalId, dsLookupTyCon, dsLookupDataCon,
+        dsLookupClass,
 
        DsMetaEnv, DsMetaVal(..), dsLookupMetaEnv, dsExtendMetaEnv,
 
@@ -43,6 +51,7 @@ import HscTypes
 import Bag
 import DataCon
 import TyCon
+import Class
 import Id
 import Module
 import Var
@@ -55,8 +64,6 @@ import NameEnv
 import OccName
 import DynFlags
 import ErrUtils
-import Bag
-import OccName
 
 import Data.IORef
 
@@ -316,6 +323,11 @@ dsLookupDataCon :: Name -> DsM DataCon
 dsLookupDataCon name
   = dsLookupGlobal name                `thenDs` \ thing ->
     returnDs (tyThingDataCon thing)
+
+dsLookupClass :: Name -> DsM Class
+dsLookupClass name
+  = dsLookupGlobal name         `thenDs` \ thing ->
+    returnDs (tyThingClass thing)
 \end{code}
 
 \begin{code}