cdepillabout / pretty-simple

pretty-printer for Haskell data types that have a Show instance
https://hackage.haskell.org/package/pretty-simple
BSD 3-Clause "New" or "Revised" License
243 stars 29 forks source link

Compact mode destroys laziness #113

Open georgefst opened 2 years ago

georgefst commented 2 years ago

Oh, and I realized that currently pretty-simple doesn't parse and pretty-print lazily with the compact option:

> pPrintOpt CheckColorTty defaultOutputOptionsDarkBg { outputOptionsCompact = True }  (repeat 3)

This doesn't print anything. Maybe I should make a separate issue about this...

Originally posted by @cdepillabout in https://github.com/cdepillabout/pretty-simple/issues/84#issuecomment-1154163224

georgefst commented 2 years ago

This is probably my fault. I'd never even thought to test it.

cdepillabout commented 2 years ago

Yeah, I think the real problem here is that pretty-simple doesn't have any tests checking the whole laziness thing!

georgefst commented 2 years ago

Yeah, I think the real problem here is that pretty-simple doesn't have any tests checking the whole laziness thing!

We have at least one! I remember from https://github.com/cdepillabout/pretty-simple/pull/67#issuecomment-651701234.