ghc-6.12.2: The GHC APISource codeContentsIndex
RtClosureInspect
Synopsis
cvObtainTerm :: HscEnv -> Int -> Bool -> RttiType -> HValue -> IO Term
cvReconstructType :: HscEnv -> Int -> GhciType -> HValue -> IO (Maybe Type)
improveRTTIType :: HscEnv -> RttiType -> RttiType -> IO (Maybe TvSubst)
data Term
= Term {
ty :: RttiType
dc :: Either String DataCon
val :: HValue
subTerms :: [Term]
}
| Prim {
ty :: RttiType
value :: [Word]
}
| Suspension {
ctype :: ClosureType
ty :: RttiType
val :: HValue
bound_to :: Maybe Name
}
| NewtypeWrap {
ty :: RttiType
dc :: Either String DataCon
wrapped_term :: Term
}
| RefWrap {
ty :: RttiType
wrapped_term :: Term
}
isTerm :: Term -> Bool
isSuspension :: Term -> Bool
isPrim :: Term -> Bool
isFun :: Term -> Bool
isFunLike :: Term -> Bool
isNewtypeWrap :: Term -> Bool
isFullyEvaluated :: a -> IO Bool
isFullyEvaluatedTerm :: Term -> Bool
termType :: Term -> RttiType
mapTermType :: (RttiType -> Type) -> Term -> Term
termTyVars :: Term -> TyVarSet
foldTerm :: TermFold a -> Term -> a
data TermFold a = TermFold {
fTerm :: TermProcessor a a
fPrim :: RttiType -> [Word] -> a
fSuspension :: ClosureType -> RttiType -> HValue -> Maybe Name -> a
fNewtypeWrap :: RttiType -> Either String DataCon -> a -> a
fRefWrap :: RttiType -> a -> a
}
foldTermM :: Monad m => TermFoldM m a -> Term -> m a
data TermFoldM m a = TermFoldM {
fTermM :: TermProcessor a (m a)
fPrimM :: RttiType -> [Word] -> m a
fSuspensionM :: ClosureType -> RttiType -> HValue -> Maybe Name -> m a
fNewtypeWrapM :: RttiType -> Either String DataCon -> a -> m a
fRefWrapM :: RttiType -> a -> m a
}
idTermFold :: TermFold Term
pprTerm :: TermPrinter -> TermPrinter
cPprTerm :: Monad m => CustomTermPrinter m -> Term -> m SDoc
cPprTermBase :: Monad m => CustomTermPrinter m
type CustomTermPrinter m = TermPrinterM m -> [Precedence -> Term -> m (Maybe SDoc)]
data Closure = Closure {
tipe :: ClosureType
infoPtr :: Ptr ()
infoTable :: StgInfoTable
ptrs :: Array Int HValue
nonPtrs :: [Word]
}
getClosureData :: a -> IO Closure
data ClosureType
= Constr
| Fun
| Thunk Int
| ThunkSelector
| Blackhole
| AP
| PAP
| Indirection Int
| MutVar Int
| MVar Int
| Other Int
isConstr :: ClosureType -> Bool
isIndirection :: ClosureType -> Bool
sigmaType :: Type -> Type
Documentation
cvObtainTerm :: HscEnv -> Int -> Bool -> RttiType -> HValue -> IO TermSource
cvReconstructType :: HscEnv -> Int -> GhciType -> HValue -> IO (Maybe Type)Source
improveRTTIType :: HscEnv -> RttiType -> RttiType -> IO (Maybe TvSubst)Source
data Term Source
Constructors
Term
ty :: RttiType
dc :: Either String DataCon
val :: HValue
subTerms :: [Term]
Prim
ty :: RttiType
value :: [Word]
Suspension
ctype :: ClosureType
ty :: RttiType
val :: HValue
bound_to :: Maybe Name
NewtypeWrap
ty :: RttiType
dc :: Either String DataCon
wrapped_term :: Term
RefWrap
ty :: RttiType
wrapped_term :: Term
show/hide Instances
isTerm :: Term -> BoolSource
isSuspension :: Term -> BoolSource
isPrim :: Term -> BoolSource
isFun :: Term -> BoolSource
isFunLike :: Term -> BoolSource
isNewtypeWrap :: Term -> BoolSource
isFullyEvaluated :: a -> IO BoolSource
isFullyEvaluatedTerm :: Term -> BoolSource
termType :: Term -> RttiTypeSource
mapTermType :: (RttiType -> Type) -> Term -> TermSource
termTyVars :: Term -> TyVarSetSource
foldTerm :: TermFold a -> Term -> aSource
data TermFold a Source
Constructors
TermFold
fTerm :: TermProcessor a a
fPrim :: RttiType -> [Word] -> a
fSuspension :: ClosureType -> RttiType -> HValue -> Maybe Name -> a
fNewtypeWrap :: RttiType -> Either String DataCon -> a -> a
fRefWrap :: RttiType -> a -> a
foldTermM :: Monad m => TermFoldM m a -> Term -> m aSource
data TermFoldM m a Source
Constructors
TermFoldM
fTermM :: TermProcessor a (m a)
fPrimM :: RttiType -> [Word] -> m a
fSuspensionM :: ClosureType -> RttiType -> HValue -> Maybe Name -> m a
fNewtypeWrapM :: RttiType -> Either String DataCon -> a -> m a
fRefWrapM :: RttiType -> a -> m a
idTermFold :: TermFold TermSource
pprTerm :: TermPrinter -> TermPrinterSource
cPprTerm :: Monad m => CustomTermPrinter m -> Term -> m SDocSource
Takes a list of custom printers with a explicit recursion knot and a term, and returns the output of the first succesful printer, or the default printer
cPprTermBase :: Monad m => CustomTermPrinter mSource
type CustomTermPrinter m = TermPrinterM m -> [Precedence -> Term -> m (Maybe SDoc)]Source
data Closure Source
Constructors
Closure
tipe :: ClosureType
infoPtr :: Ptr ()
infoTable :: StgInfoTable
ptrs :: Array Int HValue
nonPtrs :: [Word]
getClosureData :: a -> IO ClosureSource
data ClosureType Source
Constructors
Constr
Fun
Thunk Int
ThunkSelector
Blackhole
AP
PAP
Indirection Int
MutVar Int
MVar Int
Other Int
show/hide Instances
isConstr :: ClosureType -> BoolSource
isIndirection :: ClosureType -> BoolSource
sigmaType :: Type -> TypeSource
Produced by Haddock version 2.6.1