You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Strict does not refer to the state itself, but rather the tuple, which has two different semantics it is forced to choose between, because lazy state can let more programs terminate than the strict state monad.
Changing the semantics of strict state to include forcing the thunk is out of scope.
That said,
1.) It would be a perfectly reasonable request to see about adding a strict-in-the-value State and Writer type to transformers. In particular with Writer there is no recourse by which you can force what you tell in a useful way.
2.) We do have an open issue (#2) to improve the documentation on State.Strict and Writer.Strict to summarize the issue better, to help mitigate confusion.
I've had programs that repeatedly modified state leak memory because modify does not force the f s thunk.
This is surprising in a library with "strict" in its name..
The text was updated successfully, but these errors were encountered: