Closed kosmikus closed 9 years ago
I can reproduce it here... no idea yet what broke.
It seems that passing x
in GHCi no longer passes that value directly, but wraps it in some bytecode. If I put it in a box, force its evaluation and then print it, it works:
Prelude GHC.HeapView> let lb = asBox l
Prelude GHC.HeapView> getBoxedClosureData lb
APClosure {info = StgInfoTable {ptrs = 0, nptrs = 0, tipe = AP, srtlen = 0}, arity = 800703961, n_args = 0, fun = 0x00007fe32de5ac58, payload = []}
Prelude GHC.HeapView> case lb of Box a -> a `seq` ()
()
Prelude GHC.HeapView> getBoxedClosureData lb
BlackholeClosure {info = StgInfoTable {ptrs = 1, nptrs = 0, tipe = BLACKHOLE, srtlen = 0}, indirectee = 0x00007fe32e074db0}
Prelude GHC.HeapView> System.Mem.performGC
Prelude GHC.HeapView> getBoxedClosureData lb
ConsClosure {info = StgInfoTable {ptrs = 2, nptrs = 0, tipe = CONSTR_2_0, srtlen = 1}, ptrArgs = [0x00007fe32d98b810,0x00007fe32d98b7f8], dataArgs = [], pkg = "ghc-prim", modl = "GHC.Types", name = ":"}
but only so far:
Prelude GHC.HeapView> :printHeap lb
let f1 = _fun
x1 = D:Num _fun _fun _fun _fun _fun _fun _fun
in Box [(_bco f1) x1,(_bco f1) x1,(_bco f1) x1]
which finally shows the problem: Polymorphism!
Prelude GHC.HeapView> let l = [1,2,3] :: [Int]
Prelude GHC.HeapView> :printHeap l
[I# 1,I# 2,I# 3]
Can you confirm that your problems go away once you add a type signature?
There was also a bug in the byte code parser; fixed that. New version uploaded.
Hello!
This does not deserve an issue of its own, I guess. I encountered a similar problem with the example code reported in the package description for version 0.5.4: I had OverloadedStrings turned on and it took me a while to understand why I couldn't see any change after triggering evaluations. Maybe a type signature for value could help there?
By the way: great software, thanks! :-)
Thanks a lot for the release. I may be doing something stupid, but I get unexpected results using
ghc-7.8.3
.Here is an example interaction using
ghc-heap-view-0.5.1
andghc-7.6.3
:The equivalent interaction using
ghc-7.8.3
and the newghc-heap-view
looks rather less helpful: