Ensure strictness in the state in modify'.
authorPhilipp <philipp@infinipool.com>
Thu, 5 Jun 2014 11:32:58 +0000 (13:32 +0200)
committerPhilipp <philipp@infinipool.com>
Thu, 5 Jun 2014 11:32:58 +0000 (13:32 +0200)
commit56d270389ce1b852e522ce70c93e79660852a753
tree7fc74c45f724b3421b9e41fcef7f2740aedad399
parentba6960330f25aff2dbb9e9400829a5bb128846ec
Ensure strictness in the state in modify'.

The old implementation of modify' used state f with a function f that was strict in the new state.  However, in state itself, f is applied to the state in a non-strict way, so the strictness is lost.

The implementation suggested here should ensure that the state is evaluated.
Control/Monad/State/Class.hs