projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Reorganizing my mess a bit
[ghc-hetmet.git]
/
compiler
/
ghci
/
RtClosureInspect.hs
diff --git
a/compiler/ghci/RtClosureInspect.hs
b/compiler/ghci/RtClosureInspect.hs
index
ef8d367
..
170dec0
100644
(file)
--- a/
compiler/ghci/RtClosureInspect.hs
+++ b/
compiler/ghci/RtClosureInspect.hs
@@
-19,12
+19,12
@@
module RtClosureInspect(
lookupAddressEnv,
ClosureType(..),
lookupAddressEnv,
ClosureType(..),
- getClosureData,
+ getClosureData, -- :: a -> IO Closure
Closure ( tipe, infoTable, ptrs, nonPtrs ),
Closure ( tipe, infoTable, ptrs, nonPtrs ),
- getClosureType,
- isConstr,
- isIndirection,
- getInfoTablePtr,
+ getClosureType, -- :: a -> IO ClosureType
+ isConstr, -- :: ClosureType -> Bool
+ isIndirection, -- :: ClosureType -> Bool
+ getInfoTablePtr, -- :: a -> Ptr StgInfoTable
Term(..),
printTerm,
Term(..),
printTerm,
@@
-61,7
+61,6
@@
import Name
import VarEnv
import OccName
import VarSet
import VarEnv
import OccName
import VarSet
-import Unique
import {-#SOURCE#-} TcRnDriver ( tcRnRecoverDataCon )
import TysPrim
import {-#SOURCE#-} TcRnDriver ( tcRnRecoverDataCon )
import TysPrim
@@
-125,6
+124,11
@@
isPrim _ = False
termType t@(Suspension {}) = mb_ty t
termType t = Just$ ty t
termType t@(Suspension {}) = mb_ty t
termType t = Just$ ty t
+isFullyEvaluatedTerm :: Term -> Bool
+isFullyEvaluatedTerm Term {subTerms=tt} = all isFullyEvaluatedTerm tt
+isFullyEvaluatedTerm Suspension {} = False
+isFullyEvaluatedTerm Prim {} = True
+
instance Outputable (Term) where
ppr = head . customPrintTerm customPrintTermBase
instance Outputable (Term) where
ppr = head . customPrintTerm customPrintTermBase
@@
-358,7
+362,7
@@
customPrintTermBase showP =
, largeIntegerDataConName]
isTupleDC Term{dc=dc} = dc `elem` snd (unzip (elems boxedTupleArr))
isDC a_dc Term{dc=dc} = a_dc == dc
, largeIntegerDataConName]
isTupleDC Term{dc=dc} = dc `elem` snd (unzip (elems boxedTupleArr))
isDC a_dc Term{dc=dc} = a_dc == dc
- coerceShow f Term{val=val} = return . text . show . f . unsafeCoerce# $ val
+ coerceShow f = return . text . show . f . unsafeCoerce# . val
--TODO pprinting of list terms is not lazy
doList h t = do
let elems = h : getListTerms t
--TODO pprinting of list terms is not lazy
doList h t = do
let elems = h : getListTerms t
@@
-379,12
+383,6
@@
customPrintTermBase showP =
getListTerms t@Suspension{} = [t]
getListTerms t = pprPanic "getListTerms" (ppr t)
getListTerms t@Suspension{} = [t]
getListTerms t = pprPanic "getListTerms" (ppr t)
-isFullyEvaluatedTerm :: Term -> Bool
-isFullyEvaluatedTerm Term {subTerms=tt} = all isFullyEvaluatedTerm tt
-isFullyEvaluatedTerm Suspension {} = False
-isFullyEvaluatedTerm Prim {} = True
-
-
-----------------------------------
-- Type Reconstruction
-----------------------------------
-----------------------------------
-- Type Reconstruction
-----------------------------------