Scalaz state monad examples

I assume, scalaz 7.0.x and the following imports (look at answer history for scalaz 6.x): import scalaz._ import Scalaz._ The state type is defined as State[S, A] where S is type of the state and A is the type of the value being decorated. The basic syntax to create a state value makes use of … Read more