[Haskell-cafe] Why the stack overflow?

staafmeister g.c.stavenga at uu.nl
Sat Sep 19 06:37:41 EDT 2009



Hi haskell-cafe,

Why does rlist 100000 [] gives stack overflow in ghci?

rlist 0 l = return l
rlist n l = do {x <- randomRIO (1,maxBound::Int); let nl = x:l in nl `seq`
rlist (n-1) nl}

I first uses replicateM then foldM and finally an explicit function. But
they give all stack overflow
I don't know why 100000 is not absurd and it is tail recursive. Or is it
not, due to the monad structure?

greetings
Gerben

-- 
View this message in context: http://www.nabble.com/Why-the-stack-overflow--tp25520431p25520431.html
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.



More information about the Haskell-Cafe mailing list