On Thu, Jul 2, 2009 at 5:31 AM, Maciej Piechotka <span dir="ltr">&lt;<a href="mailto:uzytkownik2@gmail.com">uzytkownik2@gmail.com</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
2. I find writing monad transformers annoying.<br>
Additionally if package defines transformer A and another transformer B<br>
they need to be connected &#39;by hand&#39;.</blockquote><div><br>You have not given any concrete problems or examples, so it&#39;s hard for me to comment.  But at first glance, I would conjecture that you are relying too heavily on monads and sequential thinking.<br>
<br>Consider what your code would look like without a single monad.  Obviously you cannot talk to the network without IO, but your program can still be <i>modeled</i> purely, and then toss in IO at the last second to tie it to the network.  This model may be difficult for you because it requires your brain to be rewired; feel free to mail this list with concrete modeling problems and we will help you out.<br>
<br>As for the pure model, throw away Reader, Writer, State -- everything, and just use pure functions.  Then add monads back in <i>at small scopes</i> when they clean things up. <br><br>I used to approach problems by designing a monad for my whole program, using an appropriate stack of transformers.  I suspect such an approach led to the claim that &quot;monads are not appropriate for large software systems&quot; in a popular paper a few months ago.  As I have gained more experience, I found that this is the <i>wrong</i> way to go about using them.  Now my primary use of monads is within the scope of a single function, to tie together the helper functions in the where clause.<br>
<br>Luke<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
<br>
I find a simple solution which probably is incorrect as it hasn&#39;t been<br>
used:<br>
<br>
instance (MonadState s n, Monad (m n), MonadTrans m) =&gt;<br>
         MonadState s (m n) where<br>
        get = lift get<br>
        put = lift . put<br>
<br>
(requires FlexibleInstances MultiParamTypeClasses FlexibleContexts<br>
UndecidableInstances - two last are not extensions used by mtl)<br>
<br>
Regards<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>
</blockquote></div><br>