[Haskell] Re: elementary tracing for Haskell

Colin Runciman colin at cs.york.ac.uk
Mon Oct 11 05:38:21 EDT 2004


Phil,

> Are there any tools for beginning programmers that give traces of 
> Haskell programs?  I want something like the following.  Given the 
> defintion
>
>     sum [] = 0
>     sum (x:xs) = x + sum xs
>
> typing
>
>     sum [1,2,3]
>
> should yield this trace
>
>     sum [1,2,3]
>     1 + sum [2,3]
>     1 + 2 + sum [3]
>     1 + 2 + 3 + sum []
>     1 + 2 + 3 + 0
>     1 + 2 + 3
>     1 + 5
>     6
>
> I know there are advanced tools like Hat, but (unless I'm missing 
> something) they don't yield anything as naive as the above, and it's 
> naive users I'm trying to help here.  -- P

There is a Hat tool called hat-anim that can do this kind of thing.  It 
was developed by Tom Davie as a student project.  It is not part of the 
current "official release" of Hat but is included in the CVS version.  
Tom is now a PhD student at Canterbury (tatd2 at kent.ac.uk), supervised by 
Olaf Chitil (O.Chitil at kent.ac.uk).

Regards
Colin R




More information about the Haskell mailing list