This effort mostly just brought the core of this [1] library into GHC. The main function you will want to try is `getClosureData`,
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].
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.
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.