
I've proposed to do it at this GSOC. More exactly, it is still in the
feedback phase, I'll integrate all feedback in another blog post and in an
application for GSOC tomorrow. If you want to read about it in this stage,
you can visit my blog [0]. Feedback on reddit can be seen here[1].
The pictures from Ross Paterson were one of the reasons for my idea.
[0]: http://pgraycode.wordpress.com/2010/03/20/haskell-project-idea/
[1]:
http://www.reddit.com/r/haskell/comments/bg3bx/i_need_feedback_on_a_haskell_...
--
Mihai Maruseac
On Tue, Mar 23, 2010 at 1:02 AM, Dupont Corentin
Hello,
I’m relatively new to Haskell.
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. http://www.haskell.org/arrows/index.htm
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.
This could be done entirely automatically from the types of the functions.
Let’s try to do it on a simple example, as an exercise:
f = Map (+1)
How does this function could be represented?
It contains the (+) function.
This function has the type (+) :: Num a => a -> a -> a.
From this type we could deduce the graphic:
[image: Haskell schematic_html_m20060f13.gif]
Or a curried version:
[image: Haskell schematic_html_5155f0eb.gif]
The function (+1) then is:
[image: Haskell schematic_html_m68795eb7.gif]
The function map could be drawn like this :
[image: Haskell schematic_html_m28c92a58.gif]
Or like this:
[image: Haskell schematic_html_m6ae433ea.gif]
And the entire function map (+1) could be represented as:
[image: Haskell schematic_html_macb1643.gif]
Thanks to the advanced type system of Haskell, everything could be deduced from the type signatures.
Such a tool would be recreational and educational.
One could zoom in and out in a program, to display more or less details.
This could help understand a program, globally or locally.
We could even imagine a constructive version of the tool, where the programmer would draw functions from a toolbox, and stick them into the graphic!
Does a tool approaching this already exist? If not, would it be a good project?
Cheers,
Corentin
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe