Change the current state S using f and return nothing (Unit).
S
f
State<S, Unit> modify(S Function(S state) f) => State((state) => (unit, f(state)));