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

pTraceShowId doesn't pretty-print #19

Closed igrep closed 6 years ago

igrep commented 6 years ago

pTraceShowId (and perhaps the other functions in Debug.Pretty.Simple) doesn't seem implemented as I (and maybe you also) expect:

In GHCi,

> import qualified Data.Map as M
> import Debug.Pretty.Simple
> pTraceShowId $ M.fromList [(1, True)]
fromList "fromList [(1,True)]"
-- ^ Not pretty-printed!

although,

pPrint $ M.fromList [(1, True)]

pretty-prints!

fromList
    [
        ( 1
        , True
        )
    ]

This doesn't look consistent behavior!

cdepillabout commented 6 years ago

@igrep Thanks a lot for this bug report. That does look like inconsistent behavior.

I would definitely welcome any PRs fixing this! And tests to make sure it doesn't happen again would be really great too!

cdepillabout commented 6 years ago

Also, pinging @yigitozkavci. Maybe this was something from #18?

yigitozkavci commented 6 years ago

Yes, indeed it looks like it's introduced with #18. Thanks for reporting, I'm investigating this.

yigitozkavci commented 6 years ago

I have fixed the issue, and PR is incoming after I implement the tests. Sorry for the inconvenience.

cdepillabout commented 6 years ago

This has been fixed in #20, and uploaded to hackage as version 2.0.2.0: https://hackage.haskell.org/package/pretty-simple-2.0.2.0