haskell/pretty — pull request #9 by Peaker (2013-06-28 20:12:24+00:00)
Title: Write a test and a fix for a stack overflow bug when trying to build very large documents.

The foldr applications in vcat, hsep, and hcat use a function which is strict on its second argument.

This is a recipe for stack overflows which indeed happen when trying to build very large Doc values.

Added a test to reproduce the problem.

The fix is moving the canonization of Empty values into reduceAB, and doing it in a maximally-lazy fashion.