From 848d28cc8df29b3ff10529dcfbc4596355935c84 Mon Sep 17 00:00:00 2001 From: Pepe Iborra Date: Sun, 21 Jan 2007 11:03:44 +0000 Subject: [PATCH] Comments only --- compiler/deSugar/DsBreakpoint.lhs | 3 ++- compiler/ghci/RtClosureInspect.hs | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/compiler/deSugar/DsBreakpoint.lhs b/compiler/deSugar/DsBreakpoint.lhs index a0886cb..1d17c97 100644 --- a/compiler/deSugar/DsBreakpoint.lhs +++ b/compiler/deSugar/DsBreakpoint.lhs @@ -59,7 +59,8 @@ mkBreakpointExpr loc bkptFuncId = do let scope = filter (isValidType .idType ) scope' mod_name = moduleNameFS$ moduleName mod if null scope && instrumenting - then return (l$ HsVar lazyId) + -- need to return some expresion, hence lazy is used here as a noop (hopefully) + then return (l$ HsVar lazyId) else do when (not instrumenting) $ warnDs (text "Extracted ids:" <+> (ppr scope $$ diff --git a/compiler/ghci/RtClosureInspect.hs b/compiler/ghci/RtClosureInspect.hs index e0a1250..efeb976 100644 --- a/compiler/ghci/RtClosureInspect.hs +++ b/compiler/ghci/RtClosureInspect.hs @@ -276,7 +276,7 @@ extractUnboxed tt ba = helper tt (byteArrayContents# ba) -- TODO: Improve the offset handling in decode (make it machine dependant) ----------------------------------- --- Boilerplate Fold code for Term +-- * Traversals for Terms ----------------------------------- data TermFold a = TermFold { fTerm :: Type -> DataCon -> HValue -> [a] -> a @@ -409,6 +409,8 @@ addConstraint t1 t2 = congruenceNewtypes t1 t2 >> unifyType t1 t2 -- in the right side reptypes for newtypes as found in the lhs -- Sadly it doesn't cover all the possibilities. It does not always manage -- to recover the highest level type. See test print016 for an example +-- This is used for approximating a unification over types modulo newtypes that recovers +-- the most concrete, with-newtypes type congruenceNewtypes :: TcType -> TcType -> TcM TcType congruenceNewtypes lhs rhs -- | pprTrace "Congruence" (ppr lhs $$ ppr rhs) False = undefined @@ -465,6 +467,7 @@ cvObtainTerm hsc_env force mb_ty a = } tidy ty = tidyType (emptyTidyOccEnv, tidyVarEnv ty) ty tidyVarEnv ty = + mkVarEnv$ [ (v, setTyVarName v (tyVarName tv)) | (tv,v) <- zip alphaTyVars vars] where vars = varSetElems$ tyVarsOfType ty @@ -510,7 +513,7 @@ cvObtainTerm1 hsc_env force mb_ty hval subTerms = reOrderTerms subTermsP subTermsNP subTtypes resType <- liftM mkTyVarTy (newVar k) baseType <- instScheme (dataConRepType dc) - let myType = mkFunTys (map (fromMaybe undefined . termType) + let myType = mkFunTys (map (fromMaybe (error "cvObtainTerm1") . termType) subTerms) resType addConstraint baseType myType -- 1.7.10.4