Proposal: Add modify' to Control.Monad.State.Strict
Ross Paterson
R.Paterson at city.ac.uk
Wed Apr 30 00:24:39 UTC 2014
On Mon, Apr 28, 2014 at 09:36:02PM +0100, Niklas Hambüchen wrote:
> Code like
>
> flip execState 0 (forever $ modify (+1))
>
> leaks memory as hell, and gets fixed by using
>
> x <- get
> put $! x + 1
>
> I propose the addition of modify' to Control.Monad.State.Strict.
transformers-0.4 has modify' for both state monads -- it's useful for both.
More information about the Libraries
mailing list