[Haskell-cafe] Graphical representation of Haskell code

Ivan Miljenovic ivan.miljenovic at gmail.com
Mon Mar 22 19:12:25 EDT 2010


On 23 March 2010 10:02, Dupont Corentin <corentin.dupont at gmail.com> wrote:
> I’m relatively new to Haskell.

Welcome!

> I’m wondering if it exist a tool to graphically represent Haskell code.
>
> Look at the little graphics at: http://www.haskell.org/arrows/index.html (and following pages) from Ross Paterson.
>
> If found these very useful to understand the Arrow monad.
>
> Why not automatise this in a tool? Such a tool could draw a graphic from the code of a program.

1) Because no-one has written such a tool yet (though someone has
suggested doing one as a GSoC project).
2) I'm of the opinion that unless you just use it on small snippets,
the generated images will be too large and unweildy.

> This could be done entirely automatically from the types of the functions.

Except not everyone provides type signatures for their functions;
whilst it may be possible to use the GHC API to infer these type
signatures, my understanding is that it's preferable to use other
parsers such as haskell-src-exts as the GHC API is unstable.

[shameless plug]
My SourceGraph (http://hackage.haskell.org/package/SourceGraph) tool
does function call visualisation as part of its analyses.
[/shameless plug]


--
Ivan Lazar Miljenovic
Ivan.Miljenovic at gmail.com
IvanMiljenovic.wordpress.com


More information about the Haskell-Cafe mailing list