Have you profiled it? I wouldn't worry about recursion until I've
seen the problem. I believe GHC defaults to infinite stack size.
Have you tried using hp2ps and/or looking at the code via
threadscope?
Hello everyone
In C you can't implement main loop with recursion likevoid mainLoop() {doSomething();mainLoop();}because without optimisations stack will overflow.In haskell it's common to writemainLoop = doSomething >> mainLoop, and it doesn't leak memory because of haskell's evaluation model.Does memory leak or argument stack overflow happen in this case?mainLoop = doSomething >> mainLoop >> exit ExitSuccessWhat about this case?mainLoopModeA = dodoSomethingwhen condition mainLoopModeBmainLoopModeAmainLoopModeB = dodoSomethingElsewhen anotherCondition mainLoopModeAmainLoopModeB
or this case?mainLoopModeA = dodoSomethingif conditionthen mainLoopModeBelse mainLoopModeAmainLoopModeB = dodoSomethingElseif anotherConditionthen mainLoopModeAelse mainLoopModeB
--
Nikita Fufaev
_______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.