use ReaderT and State combination for Doc representation