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'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"><<a href="mailto:felipe.lessa@gmail.com">felipe.lessa@gmail.com</a>></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>
<<a href="mailto:baumgartner.tim@googlemail.com">baumgartner.tim@googlemail.com</a>> wrote:<br>
> I have not yet gained a good understanding of the continuation monad, but I<br>
> wonder if it could be used here. What would a clean solution look like?<br>
> Perhaps there are other things that need to be changed as well?<br>
<br>
</div>Your 'Interaction' data type is actually an instance of the more<br>
general "operational monad" (as named by Heinrich Apfelmus) or "prompt<br>
monad" (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'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 'Interaction' 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>