Okay, I just understood that 'Prompt' was just a sort of view for 'Program'.<div class="gmail_quote"><div class="im"><br><br>>I'd like to make it very accessible, so please don't hesitate to report<br>
>any difficulties with finding and understanding documentation and examples!<br><br></div>Then I think the name 'Prompt' may be misleading for those who doesn't know the MonadPrompt package. Maybe something like 'ProgramView' ?<div class="im">
<br>
<br>>> What have we achieved? Both players still can only access functions from<br>
>> whatever monad m turns out to be. But now each strategy can pile its own<br>
>> custom monad stack on the Player m monad! And of course, the use of<br>
>> the m Monad is completely optional.<br>
><br>
>Of course, the custom monad stack has to provide a projection back to<br>
>the Player m a type<br>
><br>> runMyStackT :: MyStackT (Player m) a -> Player m a<br>
<br></div>According to what Bertram said, "each strategy can pile its own custom monad stack ON the (Player m) monad".<br>Here, you are stacking the (Player m) monad ON the custom monad stack.<br>What is then the use of the 'm', in (Player <b>m</b>)? Is it not supposed to be a custom monad? (MonadIO for human, Identity for AI, etc.)<br>
<br>But then, I don't see how the game function could work:<div class="im"><br>> game :: Monad m => Player m () -> Player m () -> m ()<br></div>As it is written, it requires both players to run in the SAME monad.<br>
And if have a network player ( e.g.<b> Player (StateT Handle IO)</b> ) and an AI storing former opponent's moves ( e.g. <b>(Monad m) => Player (StateT [Move] m)</b> ), then they can't be in the same monad...<br>
<b><br></b><div class="gmail_quote"><div class="im">2010/4/14 Heinrich Apfelmus <span dir="ltr"><<a href="mailto:apfelmus@quantentunnel.de" target="_blank">apfelmus@quantentunnel.de</a>></span><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>Limestraël wrote:<div><div></div><div class="h5"><br>
> I have some difficulties to see the use of PromptT, because in the tutorial,<br>
> this type is never mentioned, and its operations (Return and :>>=) are<br>
> instead constructors of ProgramT...<br>
><br>
> Would you have some concrete examples? Because there I'm a bit lost (since<br>
> the tutorial doesn't match the operational package as it is, because of the<br>
> type PromptT)...<br>
<br>
</div></div></div><div><div></div><div class="h5">The project page<br>
<br>
<a href="http://projects.haskell.org/operational/" target="_blank">http://projects.haskell.org/operational/</a><br>
<br>
links to documentation that describes the differences to "The<br>
Operational Monad Tutorial", in particular the new Prompt and PromptT<br>
types. It also links to several examples. Two small examples are also<br>
included in the Haddock documentation.<br>
<br>
<br>
I'd like to make it very accessible, so please don't hesitate to report<br>
any difficulties with finding and understanding documentation and examples!<br>
<div><div></div><div><br>
<br>
Regards,<br>
Heinrich Apfelmus<br>
<br>
--<br>
<a href="http://apfelmus.nfshost.com" target="_blank">http://apfelmus.nfshost.com</a><br>
<br>
_______________________________________________<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></div></div></blockquote></div><br>
</div><br>