What I learned, many years ago, is that foldr was a footgun, and that foldl1' was almost certainly what I wanted.
print (foldl const 0 [undefined, undefined]) -- 0
print (foldr const 0 [undefined, undefined]) -- Exception: Prelude.undefined