<div dir="ltr">Hi Patrick, thanks.<br>I'll start digging from your great resource.<br><br>I'll try using ghc-heap-view on GHCi.<br>Interactive usage is also useful.<br><br>Thank you for your kind explanation,<br>Takenobu<br><br><br><br><br></div><div class="gmail_extra"><br><div class="gmail_quote">2018-07-07 13:05 GMT+09:00 Patrick Dougherty <span dir="ltr"><<a href="mailto:patrick.doc@ameritech.net" target="_blank">patrick.doc@ameritech.net</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="color:#000;background-color:#fff;font-family:Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-size:13px"><div id="m_3005863275543563517yiv8780269927"><div id="m_3005863275543563517yui_3_16_0_ym19_1_1530935309394_21097"><div style="color:#000;background-color:#fff;font-family:Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-size:13px" id="m_3005863275543563517yui_3_16_0_ym19_1_1530935309394_21096"><div id="m_3005863275543563517yiv8780269927"><div id="m_3005863275543563517yiv8780269927yui_3_16_0_ym19_1_1530935309394_14597"><div id="m_3005863275543563517yiv8780269927yui_3_16_0_ym19_1_1530935309394_14596" style="color:#000;background-color:#fff;font-family:Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-size:13px"><div id="m_3005863275543563517yiv8780269927yui_3_16_0_ym19_1_1530935309394_4808"><div id="m_3005863275543563517yui_3_16_0_ym19_1_1530935309394_36685"><span>Hello,</span></div></div><div id="m_3005863275543563517yiv8780269927yui_3_16_0_ym19_1_1530935309394_6494"><div id="m_3005863275543563517yui_3_16_0_ym19_1_1530935309394_36681"><span><br clear="none"></span></div></div><div id="m_3005863275543563517yiv8780269927yui_3_16_0_ym19_1_1530935309394_6495"><div dir="ltr" id="m_3005863275543563517yui_3_16_0_ym19_1_1530935309394_22769"><span id="m_3005863275543563517yiv8780269927yui_3_16_0_ym19_1_1530935309394_8337">This effort mostly just brought the core of this [1] library into GHC. The main function you will want to try is `getClosureData`,</span></div><div dir="ltr" id="m_3005863275543563517yui_3_16_0_ym19_1_1530935309394_22770"><span id="m_3005863275543563517yiv8780269927yui_3_16_0_ym19_1_1530935309394_8337">which takes any value and returns the heap representation. There are some tricky aspects about evaluation, but I will refer you to the comments about `Box`s in [1].<br></span></div><div dir="ltr" id="m_3005863275543563517yui_3_16_0_ym19_1_1530935309394_27992"><span id="m_3005863275543563517yiv8780269927yui_3_16_0_ym19_1_1530935309394_8337"><br></span></div><div dir="ltr" id="m_3005863275543563517yui_3_16_0_ym19_1_1530935309394_27993"><span id="m_3005863275543563517yiv8780269927yui_3_16_0_ym19_1_1530935309394_8337">As a shameless self-plug, I also wrote a bit about it. The first page is a brief intro to the heap, and the second is an example demonstrating how to track down a leaky accumulator. I also link to a few posts that sent me down this path.<br></span></div><div dir="ltr" id="m_3005863275543563517yui_3_16_0_ym19_1_1530935309394_36653"><span id="m_3005863275543563517yiv8780269927yui_3_16_0_ym19_1_1530935309394_8337"><br></span></div><div dir="ltr" id="m_3005863275543563517yui_3_16_0_ym19_1_1530935309394_31521"><span id="m_3005863275543563517yiv8780269927yui_3_16_0_ym19_1_1530935309394_8337">This doesn't implement all of the functionality of [1], but it pulls in enough that hopefully it should be a little more stable between GHC versions. Also, you should be able to recreate many of the functions by looking at the source of [1] on hackage.<br clear="none"></span></div></div><div id="m_3005863275543563517yiv8780269927yui_3_16_0_ym19_1_1530935309394_6565"><span><br clear="none"></span></div><div dir="ltr" id="m_3005863275543563517yiv8780269927yui_3_16_0_ym19_1_1530935309394_6566"><div id="m_3005863275543563517yui_3_16_0_ym19_1_1530935309394_27996"><span id="m_3005863275543563517yiv8780269927yui_3_16_0_ym19_1_1530935309394_6571">[1] <a rel="nofollow" shape="rect" id="m_3005863275543563517yiv8780269927yui_3_16_0_ym19_1_1530935309394_10053" href="http://hackage.haskell.org/package/ghc-heap-view-0.5.10/docs/GHC-HeapView.html" target="_blank">http://hackage.haskell.org/<wbr>package/ghc-heap-view-0.5.10/<wbr>docs/GHC-HeapView.html</a><br></span></div><div id="m_3005863275543563517yui_3_16_0_ym19_1_1530935309394_29610" dir="ltr">[2] <a href="https://patrickdoc.github.io/heap-view.html" id="m_3005863275543563517yui_3_16_0_ym19_1_1530935309394_29621" target="_blank">https://patrickdoc.github.io/<wbr>heap-view.html</a><br><span id="m_3005863275543563517yiv8780269927yui_3_16_0_ym19_1_1530935309394_6571"></span></div></div><div id="m_3005863275543563517yiv8780269927yui_3_16_0_ym19_1_1530935309394_8221"><br clear="none"></div><div id="m_3005863275543563517yiv8780269927yui_3_16_0_ym19_1_1530935309394_8311"><div id="m_3005863275543563517yui_3_16_0_ym19_1_1530935309394_21113">Best,</div><div id="m_3005863275543563517yui_3_16_0_ym19_1_1530935309394_22813">Patrick<br></div></div> </div></div></div><div id="m_3005863275543563517yui_3_16_0_ym19_1_1530935309394_21101"> <div style="font-family:Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-size:13px" id="m_3005863275543563517yui_3_16_0_ym19_1_1530935309394_21100"><div id="m_3005863275543563517yui_3_16_0_ym19_1_1530935309394_40087"><br></div><div id="m_3005863275543563517yui_3_16_0_ym19_1_1530935309394_40086">P.S. Sorry about using [1] so many times. Both libraries are called heap-view which makes it a little difficult to distinguish.<br></div><div style="font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-size:16px" id="m_3005863275543563517yui_3_16_0_ym19_1_1530935309394_21099"><div class="m_3005863275543563517yiv8780269927qtdSeparateBR" id="m_3005863275543563517yui_3_16_0_ym19_1_1530935309394_21098"><br clear="none"></div><div class="m_3005863275543563517yiv8780269927yqt0788219770" id="m_3005863275543563517yiv8780269927yqt27374"><div class="m_3005863275543563517yiv8780269927yqt8787864694" id="m_3005863275543563517yiv8780269927yqt48721"><div><div class="h5"><div dir="ltr" id="m_3005863275543563517yui_3_16_0_ym19_1_1530935309394_29611"><font id="m_3005863275543563517yui_3_16_0_ym19_1_1530935309394_38437" size="2" face="Arial"> On Friday, July 6, 2018 10:10 PM, Takenobu Tani <<a href="mailto:takenobu.hs@gmail.com" target="_blank">takenobu.hs@gmail.com</a>> wrote:<br clear="none"></font></div>  <br clear="none"><br clear="none"> </div></div><div class="m_3005863275543563517yiv8780269927y_msg_container" id="m_3005863275543563517yui_3_16_0_ym19_1_1530935309394_38400"><div><div class="h5"><div id="m_3005863275543563517yiv8780269927"><div dir="ltr" id="m_3005863275543563517yui_3_16_0_ym19_1_1530935309394_38399">Dear devs,<br clear="none"><br clear="none">I'm interested in ghc-heap-view of ghc-8.6. [1]<br clear="none">Is there a document on how to use the ghc-heap-view of ghc-8.6?<br clear="none"><br clear="none">[1]: <a rel="nofollow" shape="rect" href="https://ghc.haskell.org/trac/ghc/wiki/Status/GHC-8.6.1#Landedinmasterbranch" id="m_3005863275543563517yui_3_16_0_ym19_1_1530935309394_40142" target="_blank">https://ghc.haskell.org/trac/<wbr>ghc/wiki/Status/GHC-8.6.1#<wbr>Landedinmasterbranch</a><br clear="none"><br clear="none">Regards,<br clear="none">Takenobu<br clear="none"><br clear="none"><br clear="none"></div></div></div></div>______________________________<wbr>_________________<br clear="none">ghc-devs mailing list<br clear="none"><a rel="nofollow" shape="rect" href="mailto:ghc-devs@haskell.org" id="m_3005863275543563517yui_3_16_0_ym19_1_1530935309394_40143" target="_blank">ghc-devs@haskell.org</a><br clear="none"><a rel="nofollow" shape="rect" href="http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs" target="_blank">http://mail.haskell.org/cgi-<wbr>bin/mailman/listinfo/ghc-devs</a><br clear="none"><br clear="none"><br clear="none"></div></div></div>  </div> </div>  </div></div></div></div></div></div></blockquote></div><br></div>