
10 Oct
2013
10 Oct
'13
2:05 p.m.
Hi Claude,
Looking at the heap profile graph (generated with +RTS -h, no need to compile with profiling) I see the increasing memory use is split about evenly between STACK and BLACKHOLE. I don't know what that means or why it occurs, but replacing `small` solved that problem for me:
small = V.fromList <$> S.stream (replicateM 7 [-1,0,0,1])
Interesting! Unfortunately, my real code is more complicated, and I can't simplify its "small" function in this way. (The list [-1,0,0,1], that is being streamed in the do block, in the full program depends on some parameter that changes on each iteration.) Although, maybe I can do all the logic of the "small" function in the list monad, and stream the resulting list, as you do in the above.