The following code, being executed in Chrome, fails after printing 7492:
module Main where
import Prelude
import Effect (Effect)
import Effect.Console as Console
import Data.Array as Array
import Data.Traversable (for_)
main :: Effect Unit
main = do
for_ (Array.range 1 10000) Console.logShow
What am I doing wrong here? How can I iterate over longer arrays without causing a stack overflow?
The code is compiled using spago build and runs using parcel.
Fragment of package.json:
"devDependencies": {
"parcel": "2.7.0",
"purescript": "^0.15.4",
"spago": "^0.20.9"
}
UPD: In Orion, execution interrupts after 33793 iterations. Safari reaches 8000, getting slower and slower. This is on the "production" build of the script — spago bundle-app --to prod/index.js && parcel build prod/index.html.
seems to be working.