[Haskell-cafe] Visualising Haskell function execution

Jerzy Karczmarczuk jerzy.karczmarczuk at unicaen.fr
Sat Aug 9 00:06:34 UTC 2014


Jan Paul Posma <me at janpaulposma.nl <mailto:me at janpaulposma.nl>> wrote:

>     Last weekend my friend Steve and I did a small project for
>     visualising Haskell function execution in the browser. It's meant
>     to be used in education, and uses a tiny custom parser. I figured
>     it could be of interest for anyone here learning or teaching
>     Haskell: https://stevekrouse.github.io/hs.js/
>

Indeed, this is a nice, and potentially useful initiative, thanks.

I have some observations, though.

1. Before its "wide distribution" as suggested by Kim-Ee, it would be 
nice to provide a minimum documentation on the project page.

2. It is not always clear what is the relation between the work of the 
system, the expression expansion, and what Haskell REALLY does.
For, say: (foldr plus 0 [1 2 3 4 5]) the development/reduction depends 
on what you click. You may get

(plus1(plus2(foldrplus0[3 45]))) or
(1+(foldrplus0[2 345]))

and a beginner might have serious problems to understand what really 
happens in a true Haskell program.

3. The system accepts typing abominations, say, (foldlplus[][1 234 5]) 
and joyfully develops the structure, which cannot be finally reduced.

4. I don't understand the relation between the typing and the behaviour. 
I tested foldl with my own function put into the function editor: const 
x y = x without type declaration.
The expression is expanded, but never reduced, const remains in the 
final expression. When const type is declared, it is reduced.

5.  I tried to define my own recursive function (a factorial) and test 
it replacing one of the standard examples. This breaks the system. If it 
is not allowed, please say so explicitly. If I did something silly, 
please see my point (1).

My best regards, and thank you once more.

Jerzy Karczmarczuk
Caen, France


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20140809/0e447503/attachment-0001.html>


More information about the Haskell-Cafe mailing list