diff --git a/lib/Data/Time/LocalTime/LocalTime.hs b/lib/Data/Time/LocalTime/LocalTime.hs index b32af806..7c3244fb 100644 --- a/lib/Data/Time/LocalTime/LocalTime.hs +++ b/lib/Data/Time/LocalTime/LocalTime.hs @@ -22,6 +22,7 @@ import Data.Typeable #if LANGUAGE_Rank2Types import Data.Data #endif +import Data.Ord (comparing) -- | A simple day and time aggregate, where the day is of the specified parameter, -- and the time is a TimeOfDay. @@ -75,11 +76,19 @@ data ZonedTime = ZonedTime { #if LANGUAGE_DeriveDataTypeable #if LANGUAGE_Rank2Types #if HAS_DataPico - deriving (Data, Typeable) + deriving (Data, Typeable) #endif #endif #endif +instance Eq ZonedTime where + t1 == t2 = case comparing zonedTimeToUTC t1 t2 of + EQ -> True + _ -> False + +instance Ord ZonedTime where + compare = comparing zonedTimeToUTC + instance NFData ZonedTime where rnf (ZonedTime lt z) = lt `deepseq` z `deepseq` ()