3 Synopsis: Extract the heap representation of Haskell values and thunks
5 This library provides functions to introspect the Haskell heap, for example
6 to investigate sharing and lazy evaluation.
8 It has been inspired by (and taken code from) the vacuum package and the GHCi
9 debugger, but also allows to investiage thunks and other closures.
11 This package also provides a new GHCi-command, @:printHeap@, which allows you
12 to inspect the current heap representation of a value, including sharing and
13 cyclic references. To enable the command, you need to load the included ghci
14 script or add it to @~/.ghci@, as explained by @cabal install@. Once it is
15 set up, you can do this:
17 >> let value = "A Value"
18 >> let x = (value, if head value == 'A' then value else "", cycle [True, False])
23 >> length (take 100 (show x)) `seq` return () -- evaluate everything
26 > x16 = True : False : x16
29 You can change the maximum recursion depth using @:setPrintHeapDepth@:
31 >> :setPrintHeapDepth 3
33 >let x1 = C# 'A' : ... : ...
34 >in (x1,x1,True : ... : ...)
36 If the view is impaired by blackholes (written @_bh@), running
37 @System.Mem.performGC@ usually helps.
39 The work on this package has been supported by the Deutsche Telekom Stiftung
40 (<http://telekom-stiftung.de>).
43 Author: Joachim Breitner, Dennis Felsing
44 Maintainer: Joachim Breitner <mail@joachim-breitner.de>
45 Copyright: 2012-2014 Joachim Breitner
46 bug-reports: https://github.com/nomeata/ghc-heap-view
50 Extra-source-files: Demo.hs
53 Flag prim-supports-any
54 Description: The used GHC supports Any as an argument to foreign prim functions (GHC ticket #5931)
60 Default-Language: Haskell2010
74 build-depends: ghc >= 7.7
76 cpp-options: -DGHC_7_7
78 build-depends: ghc < 7.7
79 C-Sources: cbits/HeapView.c cbits/HeapViewPrim.cmm
82 default-language: Haskell2010
84 if flag(prim-supports-any)
85 cpp-options: -DPRIM_SUPPORTS_ANY
88 type: exitcode-stdio-1.0
90 build-depends: base, ghc-heap-view, deepseq
91 default-language: Haskell2010
95 source-repository head
97 location: git://git.nomeata.de/ghc-heap-view.git