Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion lib/Data/Time/LocalTime/LocalTime.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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` ()

Expand Down