Space leak in recursive accumulation with foldl
Thunk accumulation in lazy evaluation Haskell's default lazy evaluation defers computations by creating thunks. When using a recursive accumulation pattern, such as with foldl , these unevaluated expressions can build up in memory, leading to a space leak before the final result is demanded. Strictness and WHNF While foldl' and the BangPatterns extension are