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 hard-coded support for UTCTime #91

Closed bitc closed 3 years ago

bitc commented 3 years ago

This library is great, but doesn't work when it encounters a UTCTime:

    now <- liftIO getCurrentTime
    pPrint (now, now)

This is the result:

( 2021 - 03 - 16 18 : 04 : 08.725928 UTC
, 2021 - 03 - 16 18 : 04 : 08.725928 UTC
)

For reference, this is what Show for UTCTime looks like

(2021-03-16 18:04:08.725928 UTC,2021-03-16 18:04:08.725928 UTC)

I think it would be a good idea to hardcode support for UTCTime into this library. Some type of regex could detect the string fragments that look like UTCTime, and keep them the way they are (and possibly color them in a distinct color)

Thank you

georgefst commented 3 years ago

See #75.

TL;DR - we used to handle it better, and we can hopefully get back there without hardcoding anything.

cdepillabout commented 3 years ago

Lets close this in favor of #75.