yav / pretty-show

Tools for working with derived Show instances in Haskell.
MIT License
57 stars 15 forks source link

Handling of UTCTime is confusing #31

Closed joehealy closed 6 years ago

joehealy commented 6 years ago

When using pretty-show v 1.6.16:

getCurrentTime >>= pPrint

2018 (-08) (-05) 06 : 49 : 43.285507738 UTC

The negative numbers are very confusing.

I gather from some of the early issues (#2 from memory) there is special handling for date types.

yav commented 6 years ago

Thanks for point thins out. This is pretty tricky as there are all kinds of ways in which times could be printed, and they don't match the standard show conventions. Having said that, I made some changes that, I think, make the times in this format a little more readable:

getCurrentTime >>= \x -> pPrint [x,x]
[ (2018 - 08 - 05) (10 : 15 : 37.139576193) UTC
, (2018 - 08 - 05) (10 : 15 : 37.139576193) UTC
]

This should be available as version 1.8.1 on Hackage.

joehealy commented 6 years ago

great - thanks for that