1.
The State pattern and the State monad
blog.ploeh.dk