title: Scalaz state monad examples
body: <p>I haven't seen many examples of the scalaz state monad. There is <a href="http://scalaz.github.com/scalaz/scalaz-2.9.1-6.0.2/doc.sxr/scalaz/example/ExampleState.scala.html" rel="noreferrer">this example</a> but it is hard to understand and there is only one <a href="https://stackoverflow.com/questions/4562850/basic-scalaz-state-question">other question</a> on stack overflow it seems.</p>
  
  <p>I'm going to post a few examples I've played with but I would welcome additional ones. Also if somebody can provide example on why <code>init</code>, <code>modify</code>, <code>put</code> and <code>gets</code> are used for that would be great.</p>
  
  <p><em>Edit: <a href="http://www.youtube.com/watch?v=Jg3Uv_YWJqI" rel="noreferrer">here</a> is an awesome 2 hours presentation on the state monad.</em></p>