In the time
package we have the type ZonedTime
which represents a LocalTime
a product of localDay :: Day
and localTimeOfDay :: TimeOfDay
. LocalTime
has instances for Eq
and Ord
, but ZonedTime
does not. It seems to me that ZonedTime
s ought to be compared from an absolute reference frame still—at least as much as LocalTime
s could be.
Why doesn't ZonedTime
have Eq
and Ord
instances as well?
It's worth noting that the time
rewrite thyme
actually does have Eq
and Ord
instances, though I'd prefer not to use non-standard time types unless needed.
I can only speculate that the reason is that it is not entirely clear how times that have different zones attached should be compared, and it is easy enough to convert them to UTCTime
using zonedTimeToUTC
and compare the results if that's what's intended.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With