recover-rtti-0.1.0.0: Recover run-time type information from the GHC heap

Debug.RecoverRTTI.FlatClosure

Contents

Synopsis

# Documentation

Flattened form of Closure (with indirection nodes removed)

We only include the fields of Closure that we are interested in.

TODO: For functions (FunClosure, PAPClosure) we don't currently include any information at all. We could potentially do better here.

Constructors

 ConstrClosure Constructor application FieldsptrArgs :: [Box] pkg :: String modl :: String name :: String FunClosure FunctionsWe map FunClosure, PAPClosure and H.BCOClosure' all to this. OtherClosure Closure Unrecognized closure type

#### Instances

Instances details
 Source # Instance detailsDefined in Debug.RecoverRTTI.FlatClosure MethodsshowList :: [FlatClosure] -> ShowS #

# Re-exports

data Box #

An arbitrary Haskell value in a safe Box. The point is that even unevaluated thunks can safely be moved around inside the Box, and when required, e.g. in getBoxedClosureData, the function knows how far it has to evaluate the argument.

Constructors

 Box (Any :: Type)

#### Instances

Instances details
 Instance detailsDefined in GHC.Exts.Heap.Closures MethodsshowsPrec :: Int -> Box -> ShowS #show :: Box -> String #showList :: [Box] -> ShowS #

asBox :: a -> Box #

This takes an arbitrary value and puts it into a box. Note that calls like

asBox (head list)

will put the thunk "head list" into the box, not the element at the head of the list. For that, use careful case expressions:

case list of x:_ -> asBox x