thyme icon indicating copy to clipboard operation
thyme copied to clipboard

Fix warning-less and unnecessary orphans.

Open bitemyapp opened this issue 9 years ago • 4 comments

Show instance for UTCTime doesn't appear unless you import Data.Thyme.Format / Data.Thyme.LocalTime.

bitemyapp avatar Mar 05 '16 05:03 bitemyapp

@bitemyapp thanks for reporting this. I ran into this last night when I was baffled by the fact that the Haddock included the Show instance for UTCTime, but ghc disagreed with its availability.

I think that in general, Show instances should only be used for debug messaging, and as you provide plenty of functions for doing proper rendering of UTCTime functions to strings, it would be very helpful if these instances were not orphaned; I really prefer if runtime behavior does change depending upon which modules are imported into a scope.

nuttycom avatar Mar 05 '16 20:03 nuttycom

I'll look into this…

liyang avatar Mar 16 '16 06:03 liyang

This is how it is done in the time package. I'd also think it should go with the UTCTime instance, though there might be some arcane code depending on this behaviour (I guess the think shouldn't link anyway if some competing Show instance is defined?)

ondrap avatar May 27 '16 21:05 ondrap

I ran into the same issue with ToJSON/FromJSON. The orphan instances are in Data.Thyme.Format.Aeson, and importing Data.Thyme (UTCTime) doesn't bring them into scope. It was pretty confusing.

LightAndLight avatar Aug 03 '20 23:08 LightAndLight