[Haskell] ANNOUNCE: ghc-vis

Ivan Lazar Miljenovic ivan.miljenovic at gmail.com
Sat Sep 1 12:52:22 CEST 2012


On 1 September 2012 17:27, Dennis Felsing <dennis at felsin9.de> wrote:
> Hello,
>
> I'm pleased to announce the relase of ghc-vis. This package provides a
> way to visualize live data structures in GHCi, similar to GHCi's :print
> and vacuum-cairo. Evaluation is not forced and you can interact with the
> visualized data structures. This allows seeing Haskell's lazy evaluation
> and sharing in action. Hopefully it will be useful for teaching Haskell
> and understanding and debugging data structures.
>
> Currently there's a linear view and a graph view using GraphViz. If you
> want to see some examples of how it looks head to
>
> http://felsin9.de/nnis/ghc-vis/
>
> or just give it a try like this:
>
> $ cabal install ghc-vis
> $ echo ":script $HOME/.cabal/share/ghc-vis-0.2.1/ghci" >> ~/.ghci
> $ ghci
> GHCi, version 7.4.2: http://www.haskell.org/ghc/  :? for help
> λ> :vis
> λ> let a = [1..3]
> λ> :view a
> λ> let b = cycle a
> λ> :view b
> λ> :view "foo" ++ "bar"
> λ> :eval t1
> λ> :switch
>
> On Hackage: http://hackage.haskell.org/package/ghc-vis
>
> I'm happy to hear about bugs, feature requests and other thoughts.
>
> Dennis

In terms of your usage of graphviz, I have a couple of suggestions (as
it's maintainer ;-) on how you can improve your code:

* As of graphviz-2999.14.1.0, I've introduced isGraphvizInstalled and
quitWithoutGraphviz to try and prevent closed pipe errors when you try
to call dot when it isn't installed

* I suggest you use either hGetDot or hGetStrict from
Data.GraphViz.Commands.IO rather than hGetContents in your
GHC.Vis.Graph.dg function (maybe

-- 
Ivan Lazar Miljenovic
Ivan.Miljenovic at gmail.com
http://IvanMiljenovic.wordpress.com



More information about the Haskell mailing list