Zpf: Applicative instances for State