[commit: packages/time] master: ensure read instances for additional types -- TimeZone, Day, LocalTime, ZonedTime, TimeOfDay (60408b8)
git at git.haskell.org
git at git.haskell.org
Sun Dec 20 07:56:24 UTC 2015
Repository : ssh://git@git.haskell.org/time
On branch : master
Link : http://git.haskell.org/packages/time.git/commitdiff/60408b856a1f05b8bdda93d59c960f5a8611e31e
>---------------------------------------------------------------
commit 60408b856a1f05b8bdda93d59c960f5a8611e31e
Author: Gershom <gershom at rgntgw1-3-72-dhcp.int.colorado.edu>
Date: Fri May 22 17:32:51 2015 -0600
ensure read instances for additional types -- TimeZone, Day, LocalTime, ZonedTime, TimeOfDay
>---------------------------------------------------------------
60408b856a1f05b8bdda93d59c960f5a8611e31e
lib/Data/Time/Calendar.hs | 1 +
lib/Data/Time/Calendar/Days.hs | 3 ---
lib/Data/Time/Format.hs | 11 ++++++++---
lib/Data/Time/Format/Locale.hs | 3 ++-
lib/Data/Time/Format/Parse.hs | 8 +++++---
lib/Data/Time/LocalTime.hs | 1 +
lib/Data/Time/LocalTime/LocalTime.hs | 9 ++-------
lib/Data/Time/LocalTime/TimeOfDay.hs | 3 ---
lib/Data/Time/LocalTime/TimeZone.hs | 3 ---
9 files changed, 19 insertions(+), 23 deletions(-)
diff --git a/lib/Data/Time/Calendar.hs b/lib/Data/Time/Calendar.hs
index cf2279c..2abe1a0 100644
--- a/lib/Data/Time/Calendar.hs
+++ b/lib/Data/Time/Calendar.hs
@@ -6,3 +6,4 @@ module Data.Time.Calendar
import Data.Time.Calendar.Days
import Data.Time.Calendar.Gregorian
+import Data.Time.Format()
\ No newline at end of file
diff --git a/lib/Data/Time/Calendar/Days.hs b/lib/Data/Time/Calendar/Days.hs
index b051288..6b472b5 100644
--- a/lib/Data/Time/Calendar/Days.hs
+++ b/lib/Data/Time/Calendar/Days.hs
@@ -15,9 +15,6 @@ import Data.Data
#endif
-- | The Modified Julian Day is a standard count of days, with zero being the day 1858-11-17.
---
--- For the 'Read' instance of 'Day',
--- import "Data.Time" or "Data.Time.Format".
newtype Day = ModifiedJulianDay {toModifiedJulianDay :: Integer} deriving (Eq,Ord
#if LANGUAGE_DeriveDataTypeable
#if LANGUAGE_Rank2Types
diff --git a/lib/Data/Time/Format.hs b/lib/Data/Time/Format.hs
index e3fe96b..5ddd341 100644
--- a/lib/Data/Time/Format.hs
+++ b/lib/Data/Time/Format.hs
@@ -6,12 +6,17 @@ module Data.Time.Format
) where
import Data.Time.Format.Parse
-import Data.Time.LocalTime
+
+import Data.Time.LocalTime.TimeZone
+import Data.Time.LocalTime.TimeOfDay
+import Data.Time.LocalTime.LocalTime
+import Data.Time.Calendar.Days
+import Data.Time.Calendar.Gregorian
import Data.Time.Calendar.WeekDate
import Data.Time.Calendar.OrdinalDate
-import Data.Time.Calendar
import Data.Time.Calendar.Private
-import Data.Time.Clock
+import Data.Time.Clock.Scale
+import Data.Time.Clock.UTC
import Data.Time.Clock.POSIX
import Data.Maybe
diff --git a/lib/Data/Time/Format/Locale.hs b/lib/Data/Time/Format/Locale.hs
index 80ead81..e0e57c9 100644
--- a/lib/Data/Time/Format/Locale.hs
+++ b/lib/Data/Time/Format/Locale.hs
@@ -11,7 +11,8 @@ module Data.Time.Format.Locale (
)
where
-import Data.Time.LocalTime
+import Data.Time.LocalTime.TimeZone
+
data TimeLocale = TimeLocale {
-- |full and abbreviated week days, starting with Sunday
diff --git a/lib/Data/Time/Format/Parse.hs b/lib/Data/Time/Format/Parse.hs
index dda7e8f..20dad98 100644
--- a/lib/Data/Time/Format/Parse.hs
+++ b/lib/Data/Time/Format/Parse.hs
@@ -17,10 +17,13 @@ module Data.Time.Format.Parse
import Data.Time.Clock.POSIX
import Data.Time.Clock.Scale
import Data.Time.Clock.UTC
-import Data.Time.Calendar
+import Data.Time.Calendar.Days
+import Data.Time.Calendar.Gregorian
import Data.Time.Calendar.OrdinalDate
import Data.Time.Calendar.WeekDate
-import Data.Time.LocalTime
+import Data.Time.LocalTime.TimeZone
+import Data.Time.LocalTime.TimeOfDay
+import Data.Time.LocalTime.LocalTime
#if LANGUAGE_Rank2Types
import Control.Monad
@@ -493,4 +496,3 @@ instance Read UTCTime where
instance Read UniversalTime where
readsPrec n s = [ (localTimeToUT1 0 t, r) | (t,r) <- readsPrec n s ]
#endif
-
diff --git a/lib/Data/Time/LocalTime.hs b/lib/Data/Time/LocalTime.hs
index 046da36..735d826 100644
--- a/lib/Data/Time/LocalTime.hs
+++ b/lib/Data/Time/LocalTime.hs
@@ -5,6 +5,7 @@ module Data.Time.LocalTime
module Data.Time.LocalTime.LocalTime
) where
+import Data.Time.Format()
import Data.Time.LocalTime.TimeZone
import Data.Time.LocalTime.TimeOfDay
import Data.Time.LocalTime.LocalTime
diff --git a/lib/Data/Time/LocalTime/LocalTime.hs b/lib/Data/Time/LocalTime/LocalTime.hs
index 1c47f53..77ab2cc 100644
--- a/lib/Data/Time/LocalTime/LocalTime.hs
+++ b/lib/Data/Time/LocalTime/LocalTime.hs
@@ -15,7 +15,8 @@ module Data.Time.LocalTime.LocalTime
import Data.Time.LocalTime.TimeOfDay
import Data.Time.LocalTime.TimeZone
-import Data.Time.Calendar
+import Data.Time.Calendar.Days
+import Data.Time.Calendar.Gregorian
import Data.Time.Clock.Scale
import Data.Time.Clock.UTCDiff
@@ -32,9 +33,6 @@ import Data.Data
-- and the time is a TimeOfDay.
-- Conversion of this (as local civil time) to UTC depends on the time zone.
-- Conversion of this (as local mean time) to UT1 depends on the longitude.
---
--- For the 'Read' instance of 'LocalTime',
--- import "Data.Time" or "Data.Time.Format".
data LocalTime = LocalTime {
localDay :: Day,
localTimeOfDay :: TimeOfDay
@@ -80,9 +78,6 @@ instance Show UniversalTime where
show t = show (ut1ToLocalTime 0 t)
-- | A local time together with a TimeZone.
---
--- For the 'Read' instance of 'ZonedTime',
--- import "Data.Time" or "Data.Time.Format".
data ZonedTime = ZonedTime {
zonedTimeToLocalTime :: LocalTime,
zonedTimeZone :: TimeZone
diff --git a/lib/Data/Time/LocalTime/TimeOfDay.hs b/lib/Data/Time/LocalTime/TimeOfDay.hs
index 30e03c9..4645857 100644
--- a/lib/Data/Time/LocalTime/TimeOfDay.hs
+++ b/lib/Data/Time/LocalTime/TimeOfDay.hs
@@ -21,9 +21,6 @@ import Data.Data
#endif
-- | Time of day as represented in hour, minute and second (with picoseconds), typically used to express local time of day.
---
--- For the 'Read' instance of 'TimeOfDay',
--- import "Data.Time" or "Data.Time.Format".
data TimeOfDay = TimeOfDay {
-- | range 0 - 23
todHour :: Int,
diff --git a/lib/Data/Time/LocalTime/TimeZone.hs b/lib/Data/Time/LocalTime/TimeZone.hs
index 177d115..90846f2 100644
--- a/lib/Data/Time/LocalTime/TimeZone.hs
+++ b/lib/Data/Time/LocalTime/TimeZone.hs
@@ -30,9 +30,6 @@ import Data.Data
#endif
-- | A TimeZone is a whole number of minutes offset from UTC, together with a name and a \"just for summer\" flag.
---
--- For the 'Read' instance of 'TimeZone',
--- import "Data.Time" or "Data.Time.Format".
data TimeZone = TimeZone {
-- | The number of minutes offset from UTC. Positive means local time will be later in the day than UTC.
timeZoneMinutes :: Int,
More information about the ghc-commits
mailing list