Thanks a lot! Althaugh I have some understanding of the Haskell basics and the most important monads, I feel that I have to see more well designed code in order to become a good Haskeller. Can somebody make suggestions what materials are best to work through in order to achieve this? Are there easy research papers about Haskell programming? Or should I try the Monad.Reader? I&#39;m looking for topics that either can be used directly in many situations or that show some functional principles that boost my creativity and functional thinking.<br>
<br>Regards,<br>Tim<br><br><div class="gmail_quote">2011/11/19 Felipe Almeida Lessa <span dir="ltr">&lt;<a href="mailto:felipe.lessa@gmail.com">felipe.lessa@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Sat, Nov 19, 2011 at 6:08 PM, Tim Baumgartner<br>
&lt;<a href="mailto:baumgartner.tim@googlemail.com">baumgartner.tim@googlemail.com</a>&gt; wrote:<br>
&gt; I have not yet gained a good understanding of the continuation monad, but I<br>
&gt; wonder if it could be used here. What would a clean solution look like?<br>
&gt; Perhaps there are other things that need to be changed as well?<br>
<br>
</div>Your &#39;Interaction&#39; data type is actually an instance of the more<br>
general &quot;operational monad&quot; (as named by Heinrich Apfelmus) or &quot;prompt<br>
monad&quot; (as named by Ryan Ingram).  You will ready-to-use<br>
implementations on the packages MonadPrompt [1] and operational [2,3].<br>
 Reading their documentation you&#39;ll find some links about the<br>
development of these concepts.  MonadPrompt uses a Cont-style<br>
implementation, while operational uses a simple abstract data type<br>
together with a viewing function that avoids O(nČ) behavior.<br>
<br>
If you find it hard to describe your &#39;Interaction&#39; using operational<br>
(easiest to use package, IMO), please send us another e-mail.<br>
<br>
Cheers!<br>
<br>
[1] <a href="http://hackage.haskell.org/package/MonadPrompt" target="_blank">http://hackage.haskell.org/package/MonadPrompt</a><br>
[2] <a href="http://hackage.haskell.org/package/operational" target="_blank">http://hackage.haskell.org/package/operational</a><br>
[3] <a href="http://heinrichapfelmus.github.com/operational/Documentation.html" target="_blank">http://heinrichapfelmus.github.com/operational/Documentation.html</a><br>
<font color="#888888"><br>
--<br>
Felipe.<br>
</font></blockquote></div><br>