[project @ 2005-08-11 09:20:49 by simonpj]
authorsimonpj <unknown>
Thu, 11 Aug 2005 09:20:50 +0000 (09:20 +0000)
committersimonpj <unknown>
Thu, 11 Aug 2005 09:20:50 +0000 (09:20 +0000)
Further wibbles to moving dependency analysis back to renamer; fixes ghci failures

ghc/compiler/typecheck/TcBinds.lhs
ghc/compiler/typecheck/TcDeriv.lhs
ghc/compiler/typecheck/TcRnDriver.lhs

index ec6e0e8..a4d163a 100644 (file)
@@ -20,7 +20,7 @@ import HsSyn          ( HsExpr(..), HsBind(..), LHsBinds, LHsBind, Sig(..),
                          LSig, Match(..), IPBind(..), Prag(..),
                          HsType(..), LHsType, HsExplicitForAll(..), hsLTyVarNames, 
                          isVanillaLSig, sigName, placeHolderNames, isPragLSig,
-                         LPat, GRHSs, MatchGroup(..), isEmptyLHsBinds, pprLHsBinds,
+                         LPat, GRHSs, MatchGroup(..), pprLHsBinds,
                          collectHsBindBinders, collectPatBinders, pprPatBind
                        )
 import TcHsSyn         ( zonkId, (<$>) )
@@ -113,8 +113,8 @@ tcTopBinds binds
 tcHsBootSigs :: HsValBinds Name -> TcM [Id]
 -- A hs-boot file has only one BindGroup, and it only has type
 -- signatures in it.  The renamer checked all this
-tcHsBootSigs (ValBindsIn binds sigs)
-  = do { checkTc (isEmptyLHsBinds binds) badBootDeclErr
+tcHsBootSigs (ValBindsOut binds sigs)
+  = do { checkTc (null binds) badBootDeclErr
        ; mapM (addLocM tc_boot_sig) (filter isVanillaLSig sigs) }
   where
     tc_boot_sig (Sig (L _ name) ty)
index 326580b..3974bf0 100644 (file)
@@ -209,7 +209,7 @@ tcDeriving  :: [LTyClDecl Name]     -- All type constructors
                    HsValBinds Name)    -- Extra generated top-level bindings
 
 tcDeriving tycl_decls
-  = recoverM (returnM ([], emptyValBindsIn)) $
+  = recoverM (returnM ([], emptyValBindsOut)) $
     do {       -- Fish the "deriving"-related information out of the TcEnv
                -- and make the necessary "equations".
          overlap_flag <- getOverlapFlag
@@ -227,7 +227,7 @@ tcDeriving tycl_decls
        -- don't generate any derived bindings
        ; is_boot <- tcIsHsBoot
        ; if is_boot then
-               return (inst_info, emptyValBindsIn)
+               return (inst_info, emptyValBindsOut)
          else do
        {
 
index fb7f803..dc22e67 100644 (file)
@@ -121,7 +121,7 @@ import PrelNames    ( iNTERACTIVE, ioTyConName, printName, itName,
 import HscTypes                ( InteractiveContext(..),
                          ModIface(..), icPrintUnqual,
                          Dependencies(..) )
-import BasicTypes      ( Fixity )
+import BasicTypes      ( Fixity, RecFlag(..) )
 import SrcLoc          ( unLoc )
 #endif
 
@@ -952,7 +952,7 @@ mkPlan (L loc (ExprStmt expr _ _))  -- An expression typed at the prompt
        ; let fresh_it  = itName uniq
              the_bind  = L loc $ FunBind (L loc fresh_it) False matches emptyNameSet
              matches   = mkMatchGroup [mkMatch [] expr emptyLocalBinds]
-             let_stmt  = L loc $ LetStmt (HsValBinds (ValBindsIn (unitBag the_bind) []))
+             let_stmt  = L loc $ LetStmt (HsValBinds (ValBindsOut [(NonRecursive,unitBag the_bind)] []))
              bind_stmt = L loc $ BindStmt (nlVarPat fresh_it) expr
                                           (HsVar bindIOName) noSyntaxExpr 
              print_it  = L loc $ ExprStmt (nlHsApp (nlHsVar printName) (nlHsVar fresh_it))