Finished register machines with state monad and reader transformer