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_project_idea_maybe/
--
Mihai Maruseac
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.
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:
Or a curried version:
The function (+1) then is:
The function map could be drawn like this :
![]()
Or like this:
And the entire function map (+1) could be represented as:
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