Never mind, I misread the code, &#39;zip&#39; and the lazy definition of stream should add the necessary laziness.<br><br>  -- ryan<br><br><div class="gmail_quote">On Tue, Nov 1, 2011 at 3:36 PM, Ryan Ingram <span dir="ltr">&lt;<a href="mailto:ryani.spam@gmail.com">ryani.spam@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Try<br><br>swap p = (snd p, fst p)<br><br>or, equivalently<br><br>swap ~(x,y) = (y,x)<br><font color="#888888"><br>  -- ryan</font><div>
<div></div><div class="h5"><br><br><div class="gmail_quote">On Tue, Nov 1, 2011 at 1:30 PM, Captain Freako <span dir="ltr">&lt;<a href="mailto:capn.freako@gmail.com" target="_blank">capn.freako@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi John,<br>
<br>
I&#39;m trying to use the GHCI debugger on this code:<br>
<br>
 20 instance ArrowLoop SF where<br>
 21     loop (SF f) = SF $ \as -&gt;<br>
 22         let (bs, cs) = unzip (f (zip as (stream cs))) in bs<br>
 23       where stream ~(x:xs) = x : stream xs<br>
 24<br>
 25 swap :: (a,b) -&gt; (b,a)<br>
 26 swap (x,y) = (y,x)<br>
<br>
in order to watch the recursion of the `loop&#39; function unfold.<br>
However, when I single step through the code, I never stop on line 22<br>
(where I could, presumably, peek in at `bs&#39; and `cs&#39;, in order to see<br>
them develop):<br>
<br>
*SF&gt; :break swap<br>
Breakpoint 1 activated at SF.hs:26:1-18<br>
*SF&gt; runSF (loop (arr swap)) [1,2,3]<br>
Stopped at SF.hs:26:1-18<br>
_result :: (b, a) = _<br>
[SF.hs:26:1-18] *SF&gt; :step<br>
Stopped at SF.hs:26:14-18<br>
_result :: (b, a) = _<br>
x :: a = _<br>
y :: b = _<br>
[SF.hs:26:14-18] *SF&gt; :<br>
[1Stopped at SF.hs:23:34-42<br>
_result :: [a] = _<br>
xs :: [a] = _<br>
[SF.hs:23:34-42] *SF&gt; :<br>
Stopped at SF.hs:23:13-42<br>
_result :: [a] = _<br>
[SF.hs:23:13-42] *SF&gt; :<br>
Stopped at SF.hs:23:30-42<br>
_result :: [a] = _<br>
x :: a = _<br>
xs :: [a] = _<br>
[SF.hs:23:30-42] *SF&gt; :<br>
(Pattern repeats.)<br>
<br>
Do you have any advice?<br>
<br>
Thanks,<br>
-db<br>
<div><br>
<br>
<br>
On Mon, Oct 31, 2011 at 3:19 PM, John Lask &lt;<a href="mailto:jvlask@hotmail.com" target="_blank">jvlask@hotmail.com</a>&gt; wrote:<br>
</div><div>&gt; On 1/11/2011 1:35 AM, Captain Freako wrote:<br>
&gt;<br>
&gt; you need to study ArrowLoop and understand that. In the code<br>
<br>
</div><div><div></div><div>_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</div></div></blockquote></div><br>
</div></div></blockquote></div><br>