withState package:relude

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