timezone-series 0.1.6.1 → 0.1.8
raw patch · 8 files changed
+77/−32 lines, 8 filesdep +deepseqdep ~timePVP ok
version bump matches the API change (PVP)
Dependencies added: deepseq
Dependency ranges changed: time
API changes (from Hackage documentation)
+ Data.Time.LocalTime.TimeZone.Series: instance Control.DeepSeq.NFData Data.Time.LocalTime.TimeZone.Series.TimeZoneSeries
Files
- Data/Time/LocalTime/TimeZone/Series.hs +10/−5
- README.md +1/−1
- time_1_6_and_1_7/Data/Time/LocalTime/TimeZone/Internal/TimeVersion.hs +16/−0
- time_post_1_6/Data/Time/LocalTime/TimeZone/Internal/MapBuiltTime.hs +0/−11
- time_post_1_8/Data/Time/LocalTime/TimeZone/Internal/TimeVersion.hs +17/−0
- time_pre_1_6/Data/Time/LocalTime/TimeZone/Internal/MapBuiltTime.hs +0/−11
- time_pre_1_6/Data/Time/LocalTime/TimeZone/Internal/TimeVersion.hs +16/−0
- timezone-series.cabal +17/−4
Data/Time/LocalTime/TimeZone/Series.hs view
@@ -34,10 +34,12 @@ import Data.Maybe (listToMaybe, fromMaybe) import Data.Typeable (Typeable) import Control.Arrow (first)+import Control.DeepSeq (NFData(..)) --- Conditional import, depending on whether time library is pre-1.6 or--- post-1.6, controlled by cabal flag:-import Data.Time.LocalTime.TimeZone.Internal.MapBuiltTime (mapBuiltTime)+-- Conditional import, depending on the version of the time library,+-- controlled by cabal flag:+import Data.Time.LocalTime.TimeZone.Internal.TimeVersion (mapBuiltTime,+ mapFormatCharacter) -- $abouttzs -- A @TimeZoneSeries@ describes a timezone with a set of 'TimeZone'@@ -80,6 +82,9 @@ instance Read TimeZoneSeries where readsPrec n = map (first $ flip TimeZoneSeries []) . readsPrec n +instance NFData TimeZoneSeries where+ rnf tzs = rnf (tzsTimeZone tzs, tzsTransitions tzs)+ instance ParseTime TimeZoneSeries where buildTime locale = mapBuiltTime (flip TimeZoneSeries []) . buildTime locale @@ -93,7 +98,7 @@ instance FormatTime TimeZoneSeries where formatCharacter = - fmap (\f locale mpado -> f locale mpado . latestNonSummer) .+ fmap (mapFormatCharacter latestNonSummer) . formatCharacter -- | Given a timezone represented by a @TimeZoneSeries@, and a @UTCTime@,@@ -175,7 +180,7 @@ instance FormatTime ZoneSeriesTime where formatCharacter =- fmap (\f locale mpado -> f locale mpado . zoneSeriesTimeToZonedTime) .+ fmap (mapFormatCharacter zoneSeriesTimeToZonedTime) . formatCharacter -- | The @ZonedTime@ of a @ZoneSeriesTime@.
README.md view
@@ -43,7 +43,7 @@ packages for more information about reading and creating Olson timezone files. -Copyright (c) 2010-2015 Yitzchak Gale. All rights reserved.+Copyright (c) 2010-2016 Yitzchak Gale. All rights reserved. For licensing information, see the BSD3-style license in the file LICENSE that was originally distributed by the author together with
+ time_1_6_and_1_7/Data/Time/LocalTime/TimeZone/Internal/TimeVersion.hs view
@@ -0,0 +1,16 @@+-- | Functions that depend on the version of the @time@ library++module Data.Time.LocalTime.TimeZone.Internal.TimeVersion+(+ mapBuiltTime+ , mapFormatCharacter+)+where++-- | Map over 'Maybe' for 'buildTime' for post-1.6 time library.+mapBuiltTime :: Functor f => (a -> b) -> f a -> f b+mapBuiltTime = fmap++-- | Map for 'formatCharacter' for pre-1.8 time library.+mapFormatCharacter :: (a -> b) -> (c -> d -> b -> z) -> c -> d -> a -> z+mapFormatCharacter f g locale mpado = g locale mpado . f
− time_post_1_6/Data/Time/LocalTime/TimeZone/Internal/MapBuiltTime.hs
@@ -1,11 +0,0 @@--- | Specify the mapping function for 'buildTime'.--module Data.Time.LocalTime.TimeZone.Internal.MapBuiltTime-(- mapBuiltTime-)-where---- | Map over 'Maybe' for 'buildTime' for post-1.6 time library.-mapBuiltTime :: Functor f => (a -> b) -> f a -> f b-mapBuiltTime = fmap
+ time_post_1_8/Data/Time/LocalTime/TimeZone/Internal/TimeVersion.hs view
@@ -0,0 +1,17 @@+-- | Functions that depend on the version of the @time@ library++module Data.Time.LocalTime.TimeZone.Internal.TimeVersion+(+ mapBuiltTime+ , mapFormatCharacter+)+where++-- | Map over 'Maybe' for 'buildTime' for post-1.6 time library.+mapBuiltTime :: Functor f => (a -> b) -> f a -> f b+mapBuiltTime = fmap++-- | Map for 'formatCharacter' for post-1.8 time library.+mapFormatCharacter ::+ (a -> b) -> (c -> d -> e -> b -> z) -> c -> d -> e -> a -> z+mapFormatCharacter f g locale mpado mwidth = g locale mpado mwidth . f
− time_pre_1_6/Data/Time/LocalTime/TimeZone/Internal/MapBuiltTime.hs
@@ -1,11 +0,0 @@--- | Specify the mapping function for 'buildTime'.--module Data.Time.LocalTime.TimeZone.Internal.MapBuiltTime-(- mapBuiltTime-)-where---- | No mapping needed for 'buildTime' for pre-1.6 time library.-mapBuiltTime :: a -> a-mapBuiltTime = id
+ time_pre_1_6/Data/Time/LocalTime/TimeZone/Internal/TimeVersion.hs view
@@ -0,0 +1,16 @@+-- | Functions that depend on the version of the @time@ library++module Data.Time.LocalTime.TimeZone.Internal.TimeVersion+(+ mapBuiltTime+ , mapFormatCharacter+)+where++-- | No mapping needed for 'buildTime' for pre-1.6 time library.+mapBuiltTime :: a -> a+mapBuiltTime = id++-- | Map for 'formatCharacter' for pre-1.8 time library.+mapFormatCharacter :: (a -> b) -> (c -> d -> b -> z) -> c -> d -> a -> z+mapFormatCharacter f g locale mpado = g locale mpado . f
timezone-series.cabal view
@@ -1,5 +1,5 @@ Name: timezone-series-Version: 0.1.6.1+Version: 0.1.8 Synopsis: Enhanced timezone handling for Data.Time Description: This package endows Data.Time, from the time package, with several data types and functions@@ -19,6 +19,8 @@ Build-type: Simple Extra-source-files: README.md Cabal-version: >=1.10+Tested-with: GHC > 7.4 && < 8.1+ Source-repository HEAD type: git location: https://github.com/ygale/timezone-series.git@@ -27,18 +29,29 @@ Description: Use version < 1.6 of the time library Default: False +Flag time_1_6_and_1_7+ Description: Use version >= 1.6 and < 1.8 of the time library+ Default: False+ Library Default-language: Haskell2010 Hs-source-dirs: . if flag(time_pre_1_6) Hs-source-dirs: time_pre_1_6 else- Hs-source-dirs: time_post_1_6+ if flag(time_1_6_and_1_7)+ Hs-source-dirs: time_1_6_and_1_7+ else+ Hs-source-dirs: time_post_1_8 Exposed-modules: Data.Time.LocalTime.TimeZone.Series- Other-modules: Data.Time.LocalTime.TimeZone.Internal.MapBuiltTime+ Other-modules: Data.Time.LocalTime.TimeZone.Internal.TimeVersion Default-extensions: DeriveDataTypeable Build-depends: base >= 4.4 && < 5+ , deepseq if flag(time_pre_1_6) Build-depends: time >= 1.1.4 && < 1.6 else- Build-depends: time >= 1.6 && < 1.7+ if flag(time_1_6_and_1_7)+ Build-depends: time >= 1.6 && < 1.8+ else+ Build-depends: time >= 1.8 && < 1.9