
15 Dec
2015
15 Dec
'15
12:21 a.m.
sum for lists is implemented using foldl rather than foldl' so I suspect that's the origin of the issue. Somehow, ($!) seems to give GHC enough of a hint so as to optimize smarter thereby avoiding the thunk build-up. I don't know how this occurs though.