Tony Morris gave a talk with this snippet.
He’s using ReaderWriterState monad to provide controlled read/write access to an implicit context. That makes sense.
How do I use the code? I would like to see an example “main” program that uses this monad.
Scalaz 7 now provides this monad, and the following is a complete working example, translated with minor revisions from the example by Michael Pilquist that’s linked in the comments above.
This is tested against Scalaz 7.2.18, which is easily available from Maven’s Central Repository as a Maven or SBT dependency.