update, and Functor + Applicative instances for Program