withState package:protolude

withState f m executes action m on a state modified by applying f.