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 -> (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't work anymore. It should be replaced by :</code></font></font>
<font size="2"><code><br>evalState (sequence . repeat . StateT $ \s -> Identity (s,s+1)) 0<br></code></font></pre>
<br><div class="gmail_quote">2011/10/1 Mark Spezzano <span dir="ltr"><<a href="mailto:mark.spezzano@chariot.net.au">mark.spezzano@chariot.net.au</a>></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'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>
> Mark Spezzano wrote:<br>
>> Can someone please give me a _lucid_ and _simple_ explanation of<br>
>> exactly how continuations can be used in Haskell?<br>
>> I've already had a look at most of the tutorials and explanations on<br>
>> the web, but I'm still confused. Continuations and CPS have me<br>
>> baffled. (I have most of the Haskell textbooks and even these are<br>
>> sketchy on Continuations)<br>
>> I don't understand the notion of the Cont monad and how it can be<br>
>> used for multitasking, backtracking and interrupting computations. I<br>
>> understand that functions take in a (continuation) function that<br>
>> represents the work remaining to do, but all of the explanations on<br>
>> the web and in technical papers seems to trip over themselves in<br>
>> explaining the fundamentals to a CPS-newbie.<br>
><br>
> If you just want to implement multitasking, backtracking or interrupting computations, without continuations, I recommend my "Operational Monad Tutorial"<br>
><br>
> <a href="http://apfelmus.nfshost.com/articles/operational-monad.html" target="_blank">http://apfelmus.nfshost.com/articles/operational-monad.html</a><br>
><br>
> The link to the Cont monad is explained at the very end.<br>
><br>
><br>
> Best regards,<br>
> Heinrich Apfelmus<br>
><br>
> --<br>
> <a href="http://apfelmus.nfshost.com" target="_blank">http://apfelmus.nfshost.com</a><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>
><br>
><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>