ST Monad == code smell?

I don’t use ST much, but sometimes it is just the best solution. This can be in many scenarios: There are already well-known, efficient ways to solve a problem. Quicksort is a perfect example of this. It is known for its speed and in-place behavior, which cannot be imitated by pure code very well. You … Read more

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