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

Trailing whitespace #61

Closed sjakobi closed 4 years ago

sjakobi commented 4 years ago
> pPrintString "Union (Cat (Char 'x') Fail) (Cat (Char 'x') Line)"
Union 
    ( Cat ( Char 'x' ) Fail ) 
    ( Cat ( Char 'x' ) Line )

There's a trailing space character both on the first and second line. It would be nice if pretty-simple wouldn't do this, although it hasn't been a big problem for me so far.

cdepillabout commented 4 years ago

I totally agree with this.

I believe the pretty-printer needs to be a little smarter here.

The following issue talks about improving the output printer. If this was completed, removing trailing whitespace might be easier: https://github.com/cdepillabout/pretty-simple/issues/25