Portability | non-portable (GHC only) |
---|---|
Stability | experimental |
Maintainer | mad.one@gmail.com |
Safe Haskell | None |
vacuum
is a library that allows you to look at the graph
representation of an arbitrary value or expression.
Evaluation in Haskell proceeds by graph reduction, where values on the GHC heap are represented in a graph structure, and where nodes in the graph represent things like constructors or regular values. With this library, you can extract the graph representation of said heap values, and display them in meaningful ways to observe properties like sharing, or a birds eye view of how much memory you're using.
By itself, this module and package is not very useful to the end user - it is meant to be consumed by those who would want to visualise the abstract graph output in some meaningful way, using graphviz or ubigraph, for example.
If you are an end user who wants to visualize their data
structures and nothing more, please look at the vacuum-graphviz
package, which exports convenient APIs for rendering the output
graphs into pretty PNG/SVG files.
- type HNodeId = Int
- data HNode = HNode {}
- emptyHNode :: ClosureType -> HNode
- summary :: HNode -> ([String], [HNodeId], [Word])
- vacuum :: a -> IntMap HNode
- vacuumTo :: Int -> a -> IntMap HNode
- vacuumLazy :: a -> IntMap HNode
- vacuumStream :: a -> [(HNodeId, HNode)]
- vacuumDebug :: a -> IntMap [(StableName HValue, HNodeId)]
- dump :: a -> IO (IntMap HNode)
- dumpTo :: Int -> a -> IO (IntMap HNode)
- dumpLazy :: a -> IO (IntMap HNode)
- toAdjList :: IntMap HNode -> [(Int, [Int])]
- toAdjPair :: (HNodeId, HNode) -> (Int, [Int])
- nameGraph :: IntMap HNode -> [(String, [String])]
- data ShowHNode = ShowHNode {}
- showHNodes :: ShowHNode -> IntMap HNode -> [(String, [String])]
- data Draw e v m a = Draw {}
- newtype G e v = G {}
- draw :: Monad m => Draw e v m a -> IntMap a -> m (G e v)
- printDraw :: Draw (Int, Int) Int IO HNode
- split :: (a -> [Int]) -> IntMap a -> IntMap ([Int], [Int])
- data Closure = Closure {}
- data InfoTab
- getClosure :: a -> IO Closure
- closureType :: a -> IO ClosureType
- getInfoTab :: a -> IO InfoTab
- getInfoPtr :: a -> Ptr StgInfoTable
- peekInfoTab :: Ptr StgInfoTable -> IO InfoTab
- nodePkg :: HNode -> String
- nodeMod :: HNode -> String
- nodeName :: HNode -> String
- itabName :: InfoTab -> (String, String, String)
- type HValue = Any
Documentation
emptyHNode :: ClosureType -> HNodeSource
vacuumLazy :: a -> IntMap HNodeSource
Doesn't force anything.
vacuumStream :: a -> [(HNodeId, HNode)]Source
Returns nodes as it encounters them.
vacuumDebug :: a -> IntMap [(StableName HValue, HNodeId)]Source
To assist in "rendering" the graph to some source.
getClosure :: a -> IO ClosureSource
This is in part borrowed from RtClosureInspect.getClosureData
.
closureType :: a -> IO ClosureTypeSource
getInfoTab :: a -> IO InfoTabSource
getInfoPtr :: a -> Ptr StgInfoTableSource