Commit 81d9bd68 authored by simonpj's avatar simonpj

[project @ 2005-08-11 09:20:49 by simonpj]

Further wibbles to moving dependency analysis back to renamer; fixes ghci failures
parent ea5ae017
......@@ -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)
......
......@@ -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
{
......
......@@ -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))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment