[project @ 2002-10-18 13:41:50 by simonpj]
[ghc-hetmet.git] / ghc / compiler / typecheck / Inst.lhs
index 7eb24d0..ccd8e43 100644 (file)
@@ -80,7 +80,6 @@ import PrelNames( fromIntegerName, fromRationalName, rationalTyConName )
 import Util    ( equalLength )
 import BasicTypes( IPName(..), mapIPName, ipNameName )
 import UniqSupply( uniqsFromSupply )
-import Bag
 import Outputable
 \end{code}
 
@@ -309,13 +308,12 @@ newMethodFromName origin ty name
        -- always a class op, but with -fno-implicit-prelude GHC is
        -- meant to find whatever thing is in scope, and that may
        -- be an ordinary function. 
-    newMethod origin id [ty]   `thenM` \ inst ->
-    returnM (instToId inst)
+    newMethod origin id [ty]
 
 newMethod :: InstOrigin
          -> TcId
          -> [TcType]
-         -> TcM Inst
+         -> TcM Id
 newMethod orig id tys
   =    -- Get the Id type and instantiate it at the specified types
     let
@@ -329,7 +327,7 @@ newMethodWithGivenTy orig id tys theta tau
   = getInstLoc orig                    `thenM` \ loc ->
     newMethodWith loc id tys theta tau `thenM` \ inst ->
     extendLIE inst                     `thenM_`
-    returnM inst
+    returnM (instToId inst)
 
 --------------------------------------------
 -- newMethodWith and newMethodAtLoc do *not* drop the