sequence causing stack overflow on pretty small lists

Niklas Hambüchen mail at nh2.me
Mon Aug 26 11:16:41 CEST 2013


As an example that this actually makes problems in production code, I
found this in the wildlife:

https://github.com/ndmitchell/shake/blob/e0e0a43/Development/Shake/Database.hs#L394

    -- Do not use a forM here as you use too much stack space
    bad <- (\f -> foldM f [] (Map.toList status)) $ \seen (i,v) -> ...

I could bet that there is a lot of code around on which we rely, which
has the same problem but does not go that far in customisation.




More information about the Libraries mailing list