<br><font size=2 face="sans-serif">hartthoma@linuxpt:~&gt;cat test.hs</font>
<br><font size=2 face="sans-serif">import Debug.Trace</font>
<br>
<br><font size=2 face="sans-serif">foo = foldl (\first second -&gt;</font>
<br><font size=2 face="sans-serif">&nbsp; (trace ( &quot;first: &quot;
++ ( show first) ) first)</font>
<br><font size=2 face="sans-serif">&nbsp; +</font>
<br><font size=2 face="sans-serif">&nbsp; (trace ( &quot;second: &quot;
++ (show second) ) second) ) 0 [1,2,3]</font>
<br>
<br><font size=2 face="sans-serif">bar = foldl (+)</font>
<br>
<br><font size=2 face="sans-serif">traceIt x = trace (&quot;\nTraceIt:\n&quot;++show
x++&quot;\n&quot;) x</font>
<br><font size=2 face="sans-serif">hartthoma@linuxpt:~&gt;ghc -e foo test.hs</font>
<br><font size=2 face="sans-serif">first: 0</font>
<br><font size=2 face="sans-serif">second: 1</font>
<br><font size=2 face="sans-serif">first: 1</font>
<br><font size=2 face="sans-serif">second: 2</font>
<br><font size=2 face="sans-serif">first: 3</font>
<br><font size=2 face="sans-serif">second: 3</font>
<br><font size=2 face="sans-serif">6</font>
<br><font size=2 face="sans-serif">hartthoma@linuxpt:~&gt;</font>
<br>
<br><font size=2 face="sans-serif">hope this helps.</font>
<br>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>Ian Duncan &lt;iand675@gmail.com&gt;</b>
</font>
<br><font size=1 face="sans-serif">Sent by: haskell-cafe-bounces@haskell.org</font>
<p><font size=1 face="sans-serif">08/16/2007 08:20 PM</font>
<td width=59%>
<table width=100%>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">To</font></div>
<td><font size=1 face="sans-serif">haskell-cafe@haskell.org</font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">Subject</font></div>
<td><font size=1 face="sans-serif">[Haskell-cafe] Looking at program execution</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br><tt><font size=2>Is there any way to view the steps that a haskell
program goes &nbsp;<br>
through step by step?<br>
I'm thinking something similar to what I've seen in things I've been &nbsp;<br>
reading. For example:<br>
foldl (+) 0 [1..10]<br>
=&gt; (0+1)<br>
=&gt; ((0+1)+2)<br>
=&gt; (((0+1)+2)+3)<br>
=&gt; etc.<br>
I've seen these sorts of line-by-line execution steps, but I was &nbsp;<br>
curious if there was any way to simply type in a function and its &nbsp;<br>
arguments and have ghci or hugs or something print out this sort of &nbsp;<br>
visual representation of what's going on. Anyone know of something &nbsp;<br>
like this?<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
Haskell-Cafe@haskell.org<br>
http://www.haskell.org/mailman/listinfo/haskell-cafe<br>
</font></tt>
<br>
<br>
<span style="font-family:sans-serif,helvetica; font-size:10pt; color:#000000">---</span><br>
<br>
<span style="font-family:sans-serif,helvetica; font-size:10pt; color:#000000">This e-mail may contain confidential and/or privileged information. If you </span><br>
<span style="font-family:sans-serif,helvetica; font-size:10pt; color:#000000">are not the intended recipient (or have received this e-mail in error) </span><br>
<span style="font-family:sans-serif,helvetica; font-size:10pt; color:#000000">please notify the sender immediately and destroy this e-mail. Any </span><br>
<span style="font-family:sans-serif,helvetica; font-size:10pt; color:#000000">unauthorized copying, disclosure or distribution of the material in this </span><br>
<span style="font-family:sans-serif,helvetica; font-size:10pt; color:#000000">e-mail is strictly forbidden.</span><br>