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

doc request #7

Closed jwaldmann closed 7 years ago

jwaldmann commented 7 years ago

Hi. Interesting project. Can you explain (in the docs) how this works? You are calling "show" and then parse the output, looking for parentheses, brackets, braces; then use this for indentation and colouring?

So, I can use this for (data types with Show instances that procude) strings that have matching pairs of these kind of parens? (So, it would work for textual renderings of JSON? Not that I'd want to do this - it's just for clarification.)

cdepillabout commented 7 years ago

You are calling "show" and then parse the output, looking for parentheses, brackets, braces; then use this for indentation and colouring?

This is exactly what's happening. So I believe it would work with JSON.

Do you have any suggestion about where this information should be placed? Do you think it goes better somewhere like the README? Or maybe in the haddock documentation? Or both?

jwaldmann commented 7 years ago

I suggest to mention this on the project's github and hackage front pages, so potential users see it early.

cdepillabout commented 7 years ago

I ended up adding it to the to the README:

https://github.com/cdepillabout/pretty-simple#other-uses

I also added a small note on the pString function.

Thanks for the suggestion!