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

remove whitespace on ends of lines #79

Closed cdepillabout closed 4 years ago

cdepillabout commented 4 years ago

When trying to pretty-print a datatype like the following:

[#<Foobar id: 1, user_id: 1, name: "sample.pdf", created_at: "2020-09-11 05:12:11", recognized_at: "2020-09-11 05:13:26">]

I get an output like the following:

[ #<Foobar id: 1
, user_id: 1
, name: "sample.pdf"■
, created_at: "2020-09-11 05:12:11"■
, recognized_at: "2020-09-11 05:13:26" >
] 

Here, the "■" character represents a line-ending space.

It appears that spaces come after a string (like "sample.pdf"), but not after a number (like 1).


The reason it would be nice to fix this is because sometimes I use the pretty-simple executable to format stuff in my editor, but I have my editor setup to highlight lines ending with a space (in order to not have any trailing space characters that I don't intend).

georgefst commented 4 years ago

Are you using HEAD, or the last release? It looks like this is already fixed.

cdepillabout commented 4 years ago

Oops, I didn't realize I wasn't running HEAD! Sorry for the noise :-)

georgefst commented 4 years ago

No worries - all the more reason for #83!