Get the latest tech news
State Monad for the Rest of Us
Random thoughts about programming
In fact, the series starts from the scratch and builds an intuition on State Monad from the very ground up. Important note: using a state monad is amazingly easy; building one from the scratch is a bit more challenging. Chapter 7: in which you use a bit of type modeling to hide the state handling logic.
Or read this on Hacker News