[commit: packages/time] format-widths, ghc, master, posix-perf, tasty: Rewrite NFData instances using rnf (f37d418)
git at git.haskell.org
git at git.haskell.org
Fri Apr 21 16:55:38 UTC 2017
Repository : ssh://git@git.haskell.org/time
On branches: format-widths,ghc,master,posix-perf,tasty
Link : http://git.haskell.org/packages/time.git/commitdiff/f37d418745e0ba95788dfbba355ef3cf87d16b0f
>---------------------------------------------------------------
commit f37d418745e0ba95788dfbba355ef3cf87d16b0f
Author: Ashley Yakeley <ashley at yakeley.org>
Date: Tue Dec 6 19:46:49 2016 -0800
Rewrite NFData instances using rnf
>---------------------------------------------------------------
f37d418745e0ba95788dfbba355ef3cf87d16b0f
lib/Data/Time/Clock/UTC.hs | 2 +-
lib/Data/Time/LocalTime/LocalTime.hs | 4 ++--
lib/Data/Time/LocalTime/TimeOfDay.hs | 2 +-
lib/Data/Time/LocalTime/TimeZone.hs | 2 +-
4 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/lib/Data/Time/Clock/UTC.hs b/lib/Data/Time/Clock/UTC.hs
index 27c8bb6..683323f 100644
--- a/lib/Data/Time/Clock/UTC.hs
+++ b/lib/Data/Time/Clock/UTC.hs
@@ -45,7 +45,7 @@ data UTCTime = UTCTime {
#endif
instance NFData UTCTime where
- rnf (UTCTime d t) = d `deepseq` t `deepseq` ()
+ rnf (UTCTime d t) = rnf d `seq` rnf t `seq` ()
instance Eq UTCTime where
(UTCTime da ta) == (UTCTime db tb) = (da == db) && (ta == tb)
diff --git a/lib/Data/Time/LocalTime/LocalTime.hs b/lib/Data/Time/LocalTime/LocalTime.hs
index 77ab2cc..74e4f9c 100644
--- a/lib/Data/Time/LocalTime/LocalTime.hs
+++ b/lib/Data/Time/LocalTime/LocalTime.hs
@@ -47,7 +47,7 @@ data LocalTime = LocalTime {
)
instance NFData LocalTime where
- rnf (LocalTime d t) = d `deepseq` t `deepseq` ()
+ rnf (LocalTime d t) = rnf d `seq` rnf t `seq` ()
instance Show LocalTime where
show (LocalTime d t) = (showGregorian d) ++ " " ++ (show t)
@@ -91,7 +91,7 @@ data ZonedTime = ZonedTime {
#endif
instance NFData ZonedTime where
- rnf (ZonedTime lt z) = lt `deepseq` z `deepseq` ()
+ rnf (ZonedTime lt z) = rnf lt `seq` rnf z `seq` ()
utcToZonedTime :: TimeZone -> UTCTime -> ZonedTime
utcToZonedTime zone time = ZonedTime (utcToLocalTime zone time) zone
diff --git a/lib/Data/Time/LocalTime/TimeOfDay.hs b/lib/Data/Time/LocalTime/TimeOfDay.hs
index 4645857..318c87d 100644
--- a/lib/Data/Time/LocalTime/TimeOfDay.hs
+++ b/lib/Data/Time/LocalTime/TimeOfDay.hs
@@ -40,7 +40,7 @@ data TimeOfDay = TimeOfDay {
)
instance NFData TimeOfDay where
- rnf (TimeOfDay h m s) = h `deepseq` m `deepseq` s `seq` () -- FIXME: Data.Fixed had no NFData instances yet at time of writing
+ rnf (TimeOfDay h m s) = rnf h `seq` rnf m `seq` s `seq` () -- FIXME: Data.Fixed had no NFData instances yet at time of writing
-- | Hour zero
midnight :: TimeOfDay
diff --git a/lib/Data/Time/LocalTime/TimeZone.hs b/lib/Data/Time/LocalTime/TimeZone.hs
index 1b97643..b876556 100644
--- a/lib/Data/Time/LocalTime/TimeZone.hs
+++ b/lib/Data/Time/LocalTime/TimeZone.hs
@@ -46,7 +46,7 @@ data TimeZone = TimeZone {
)
instance NFData TimeZone where
- rnf (TimeZone m so n) = m `deepseq` so `deepseq` n `deepseq` ()
+ rnf (TimeZone m so n) = rnf m `seq` rnf so `seq` rnf n `seq` ()
-- | Create a nameless non-summer timezone for this number of minutes
minutesToTimeZone :: Int -> TimeZone
More information about the ghc-commits
mailing list