[Haskell-cafe] State monad strictness - how?

Yitzchak Gale gale at sefer.org
Wed Jan 10 17:07:41 EST 2007

> ...how would one know that State is lazy and StateT is strict?
> I don't see that in the Haddock documentation.

You're right, it is not in the docs. I don't think anyone would
have planned it that way. StateT is strict only because there
happens to be a line in a do-expression that looks like:
		(a, s') <- runStateT m s
The tuple pattern-match causes the strictness.
That appears accidental, so it seems to be just an honest bug.


More information about the Haskell-Cafe mailing list