How can we encode state in lambda calculus?