sequence is not tail recursive, doesn't work with large inputs in strict monads
|Reported by:||EyalLotem||Owned by:|
|Keywords:||sequence tail recursive||Cc:||daniel.is.fischer@…, cheecheeo@…|
|Type of failure:||None/Unknown||Difficulty:||Unknown|
|Test Case:||Blocked By:|
replicateM 10000000 (randomIO >>= evaluate)
blows the stack because of "sequence".
I think it is important for Haskell programmers to be able to compose existing components without having to worry about the operational semantics of laziness, so it is important for GHC to specialize "sequence" calls to a tail-recursive one when a strict monad is in use.
Attached is the test case.