[Haskell-cafe] Re: Visualizing function application

Gleb Alexeyev gleb.alexeev at gmail.com
Mon Jan 18 05:38:58 EST 2010

Martijn van Steenbergen wrote:
> Dear café,
> I am deeply impressed with Vacuum[1][2], Ubigraph[3] and especially 
> their combination[4]. I can trivially and beautifully visualize the ASTs 
> that my parser produces. I can visualize zippers of the ASTs and confirm 
> that sharing is optimal.
> Ubigraph is also able to animate graph *mutations*, as shown by the 
> various demos on Ubigraph's website. How cool would it be if we could 
> tell vacuum-ubigraph: here, show this tree, and then show how the tree 
> changes when we apply this function on it. We could see how [1,2,3] is 
> transformed into a ring when cycle is applied on it, or we could see how 
> a list is consumed node by node when a foldr is applied.
> I have no idea how difficult this is or how to begin, so I thought I'd 
> throw the idea out here. Perhaps it is appealing enough that someone 
> picks it up and implements it. :-)
> Martijn.
> [1] http://hackage.haskell.org/package/vacuum
> [2] http://www.youtube.com/watch?v=oujaqo9GAmA
> [3] http://ubietylab.net/ubigraph/content/Demos/index.html
> [4] http://hackage.haskell.org/package/vacuum-ubigraph

Hello, Martijn.

I'm glad you found vacuum-ubigraph useful.

I have to tell you that it was hacked in a hour or so based on the code 
from vacuum-cairo. I'm in no way an expert in GHC runtime internals.

The spec of application visualization as you propose it is unclear: in 
what sense the list [1,2,3] is transformed to a ring, given that only 
values 1,2,3 are shared, not cons-cells? Can this definition of 
transformation be extrapolated to a function like parseXml :: [Char] -> 

As to 'list consumed by foldr', things seem even more unclear. I'm under 
impression that Vacuum allows inspection of representation of static 
values, and here we need the history of evaluation, with information 
which nodes and when get collected as garbage. I doubt this is possible, 
but we'll have to wait until Matt Morrow or anyone else more 
knowledgeable than me comments.

More information about the Haskell-Cafe mailing list