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

Add pTraceShow and pTraceShowWith #104

Closed LeviButcher closed 2 years ago

LeviButcher commented 2 years ago

Solves #100 Adds pTraceWith and pTraceShowWith

I added some doc comments but was unsure if that something added just before merge. For instance the version number.

Let me know of any issues with this change. Thanks!

georgefst commented 2 years ago

I added some doc comments but was unsure if that something added just before merge.

That's a good question. I'll defer to @cdepillabout since I'm not usually in the habit of adding @since annotations (They are definitely good to have! It just seems like something crying out for some sort of automated tooling, which AFAIK doesn't exist. And I'm lazy.).

Also, could you please rebase on master, and add pragmas as in #103? Thanks!

LeviButcher commented 2 years ago

Warning pragmas and rebase done. Should be good to go. :+1:

cdepillabout commented 2 years ago

I think this looks good, but I do have one small concern.

What if https://github.com/haskell/core-libraries-committee/issues/36 gets accepted, but they slightly change the type signature or name of the proposed functions? Then we'll have do to a major version bump of pretty-simple to match the changes.

(I don't think this is a really big concern or anything, but it might be easier to just hold off on merging this until the above issue gets decided. I'm fine with deferring to @georgefst to make the final call on this.)


As for the @since annotations, I completely agree with @georgefst. They are great to have, but annoying to maintain without some sort of automated tooling. I generally haven't been adding them.

georgefst commented 2 years ago

What if haskell/core-libraries-committee#36 gets accepted, but they slightly change the type signature or name of the proposed functions?

Good point. I think it's best to wait for that proposal to be approved. I don't expect it'll take long, and I'm watching the thread.

georgefst commented 2 years ago

Good point. I think it's best to wait for that proposal to be approved. I don't expect it'll take long, and I'm watching the thread.

Approved: https://github.com/haskell/core-libraries-committee/issues/36#issuecomment-1093384707!