title: How to design a monadic stack?
body: <p>How do you design and build your monadic stacks? For the first time I need to build a monadic stack (using transformers) to solve a real world problem, but I'm not thoroughly sure in which <em>order</em> to stack the transformers. As you already know, as long as a computation has kind <code>* -&gt; *</code>, basically anything can play the role of the inner monad in a transformer, thus a couple of questions:</p>
  
  <ul>
  <li>Should some particular transformer be at the top of the stack (e.g. ReaderT? WriterT?)</li>
  <li>What should drive the design? Intuition? Types? (e.g. shape the stack according to your API's needs)</li>
  <li>Is every stack isomorphic to each other (to a certain extent) or is it likely that, if I build my stack incorrectly I might end up to not being able to use certain underlying monads or to have a big bloated mess of <code>lift . lift . liftIO [...]</code>? My gut feeling would suggest that, if the transformers derive some instances (e.g. MonadReader, MonadIO, etc, like most transformers in <code>mtl</code> do), it shouldn't matter in which order I put the transformers.</li>
  </ul>
  
  <p>I'm interest in hearing from seasoned Haskellers about best practices or rules of thumb.</p>
  
  <p><code>forever $ print "Thanks!"</code></p>
  
  <p>A.</p>