Having worked with the operational-package, I only can recommend it. In fact I was trying to do the same thing you are now.<br>The only thing is that operational needs the use of GADTs, which come as an extension, but still are a useful and heavily used feature.<br>

<br><font size="2">BTW Heinrich, the </font><br>

<pre><font size="2"><code>evalState (sequence . repeat . State $ \s -&gt; (s,s+1)) 0<br><span style="font-family: arial,helvetica,sans-serif;"></span></code></font><br><font><font size="2"><code>at the end doesn&#39;t work anymore. It should be replaced by :</code></font></font>
<font size="2"><code><br>evalState (sequence . repeat . StateT $ \s -&gt; Identity (s,s+1)) 0<br></code></font></pre>
<br><div class="gmail_quote">2011/10/1 Mark Spezzano <span dir="ltr">&lt;<a href="mailto:mark.spezzano@chariot.net.au">mark.spezzano@chariot.net.au</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Hi Heinrich,<br>
<br>
I&#39;m really looking to use the Cont monad itself--but the link you gave me is also helpful, so thank you.<br>
<br>
If anyone else has words of wisdom to add to this thread please feel free to pitch in.<br>
<br>
Thanks,<br>
<font color="#888888"><br>
Mark<br>
</font><div><div></div><div class="h5"><br>
On 01/10/2011, at 5:08 PM, Heinrich Apfelmus wrote:<br>
<br>
&gt; Mark Spezzano wrote:<br>
&gt;&gt; Can someone please give me a _lucid_ and  _simple_ explanation of<br>
&gt;&gt; exactly how continuations can be used in Haskell?<br>
&gt;&gt; I&#39;ve already had a look at most of the tutorials and explanations on<br>
&gt;&gt; the web, but I&#39;m still confused. Continuations and CPS have me<br>
&gt;&gt; baffled. (I have most of the Haskell textbooks and even these are<br>
&gt;&gt; sketchy on Continuations)<br>
&gt;&gt; I don&#39;t understand the notion of the Cont monad and how it can be<br>
&gt;&gt; used for multitasking, backtracking and interrupting computations. I<br>
&gt;&gt; understand that functions  take in a (continuation) function that<br>
&gt;&gt; represents the work remaining to do, but all of the explanations on<br>
&gt;&gt; the web and in technical papers seems to trip over themselves in<br>
&gt;&gt; explaining the fundamentals to a CPS-newbie.<br>
&gt;<br>
&gt; If you just want to implement multitasking, backtracking or interrupting computations, without continuations, I recommend my &quot;Operational Monad Tutorial&quot;<br>
&gt;<br>
&gt;  <a href="http://apfelmus.nfshost.com/articles/operational-monad.html" target="_blank">http://apfelmus.nfshost.com/articles/operational-monad.html</a><br>
&gt;<br>
&gt; The link to the Cont monad is explained at the very end.<br>
&gt;<br>
&gt;<br>
&gt; Best regards,<br>
&gt; Heinrich Apfelmus<br>
&gt;<br>
&gt; --<br>
&gt; <a href="http://apfelmus.nfshost.com" target="_blank">http://apfelmus.nfshost.com</a><br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Haskell-Cafe mailing list<br>
&gt; <a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
&gt; <a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
&gt;<br>
&gt;<br>
<br>
<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">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>