timezone-series 0.1.9 → 0.1.13
raw patch · 5 files changed
+44/−52 lines, 5 filesdep ~timePVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: time
API changes (from Hackage documentation)
- Data.Time.LocalTime.TimeZone.Series: instance Data.Time.Format.FormatTime Data.Time.LocalTime.TimeZone.Series.TimeZoneSeries
- Data.Time.LocalTime.TimeZone.Series: instance Data.Time.Format.FormatTime Data.Time.LocalTime.TimeZone.Series.ZoneSeriesTime
- Data.Time.LocalTime.TimeZone.Series: instance Data.Time.Format.Parse.ParseTime Data.Time.LocalTime.TimeZone.Series.TimeZoneSeries
- Data.Time.LocalTime.TimeZone.Series: instance Data.Time.Format.Parse.ParseTime Data.Time.LocalTime.TimeZone.Series.ZoneSeriesTime
+ Data.Time.LocalTime.TimeZone.Series: instance Data.Time.Format.Format.Class.FormatTime Data.Time.LocalTime.TimeZone.Series.TimeZoneSeries
+ Data.Time.LocalTime.TimeZone.Series: instance Data.Time.Format.Format.Class.FormatTime Data.Time.LocalTime.TimeZone.Series.ZoneSeriesTime
+ Data.Time.LocalTime.TimeZone.Series: instance Data.Time.Format.Parse.Class.ParseTime Data.Time.LocalTime.TimeZone.Series.TimeZoneSeries
+ Data.Time.LocalTime.TimeZone.Series: instance Data.Time.Format.Parse.Class.ParseTime Data.Time.LocalTime.TimeZone.Series.ZoneSeriesTime
Files
- Data/Time/LocalTime/TimeZone/Internal/TimeVersion.hs +0/−40
- Data/Time/LocalTime/TimeZone/Series.hs +39/−6
- LICENSE +1/−1
- README.md +1/−1
- timezone-series.cabal +3/−4
− Data/Time/LocalTime/TimeZone/Internal/TimeVersion.hs
@@ -1,40 +0,0 @@-{-# LANGUAGE CPP #-}---- | Functions that depend on the version of the @time@ library--module Data.Time.LocalTime.TimeZone.Internal.TimeVersion-(- mapBuiltTime- , mapFormatCharacter-)-where--#if MIN_VERSION_time(1,6,0)--mapBuiltTime :: Functor f => (a -> b) -> f a -> f b-mapBuiltTime = fmap--#else--mapBuiltTime :: a -> a-mapBuiltTime = id--#endif--#if MIN_VERSION_time(1,9,1)--mapFormatCharacter :: (a -> b) -> Maybe (x -> b -> String) -> Maybe (x -> a -> String)-mapFormatCharacter f = fmap (\g x -> g x . f)--#elif MIN_VERSION_time(1,8,0)--mapFormatCharacter ::- (a -> b) -> (c -> d -> e -> b -> z) -> c -> d -> e -> a -> z-mapFormatCharacter f g locale mpado mwidth = g locale mpado mwidth . f--#else--mapFormatCharacter :: (a -> b) -> (c -> d -> b -> z) -> c -> d -> a -> z-mapFormatCharacter f g locale mpado = g locale mpado . f--#endif
Data/Time/LocalTime/TimeZone/Series.hs view
@@ -32,21 +32,23 @@ ZonedTime(ZonedTime), utcToLocalTime, localTimeToUTC) #if MIN_VERSION_time(1,9,1)-import Data.Time.Format.Internal (FormatTime(formatCharacter), ParseTime(buildTime))+import Data.Time.Format.Internal+ ( FormatTime(formatCharacter)+ , ParseTime( buildTime+ , parseTimeSpecifier+ , substituteTimeSpecifier+ )+ ) #else import Data.Time (FormatTime(formatCharacter), ParseTime(buildTime)) #endif import Data.List (partition) import Data.Maybe (listToMaybe, fromMaybe)+import Data.Proxy (Proxy(Proxy)) import Data.Typeable (Typeable) import Control.Arrow (first) import Control.DeepSeq (NFData(..)) --- 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' -- objects. Each @TimeZone@ object describes the clock setting in the@@ -93,7 +95,20 @@ instance ParseTime TimeZoneSeries where buildTime locale = mapBuiltTime (flip TimeZoneSeries []) . buildTime locale+#if MIN_VERSION_time(1,9,1)+ parseTimeSpecifier _ = parseTimeSpecifier (Proxy :: Proxy TimeZone)+ substituteTimeSpecifier _ =+ substituteTimeSpecifier (Proxy :: Proxy TimeZone)+#endif +#if MIN_VERSION_time(1,6,0)+mapBuiltTime :: Functor f => (a -> b) -> f a -> f b+mapBuiltTime = fmap+#else+mapBuiltTime :: a -> a+mapBuiltTime = id+#endif+ -- | The latest non-summer @TimeZone@ in a @TimeZoneSeries@ is in some -- sense representative of the timezone. latestNonSummer :: TimeZoneSeries -> TimeZone@@ -107,6 +122,19 @@ fmap (mapFormatCharacter latestNonSummer) . formatCharacter +#if MIN_VERSION_time(1,9,1)+mapFormatCharacter ::+ (a -> b) -> Maybe (x -> b -> String) -> Maybe (x -> a -> String)+mapFormatCharacter f = fmap (\g x -> g x . f)+#elif MIN_VERSION_time(1,8,0)+mapFormatCharacter ::+ (a -> b) -> (c -> d -> e -> b -> z) -> c -> d -> e -> a -> z+mapFormatCharacter f g locale mpado mwidth = g locale mpado mwidth . f+#else+mapFormatCharacter :: (a -> b) -> (c -> d -> b -> z) -> c -> d -> a -> z+mapFormatCharacter f g locale mpado = g locale mpado . f+#endif+ -- | Given a timezone represented by a @TimeZoneSeries@, and a @UTCTime@, -- provide the state of the timezone's clocks at that time. timeZoneFromSeries :: TimeZoneSeries -> UTCTime -> TimeZone@@ -183,6 +211,11 @@ instance ParseTime ZoneSeriesTime where buildTime locale = mapBuiltTime zonedTimeToZoneSeriesTime . buildTime locale+#if MIN_VERSION_time(1,9,1)+ parseTimeSpecifier _ = parseTimeSpecifier (Proxy :: Proxy ZonedTime)+ substituteTimeSpecifier _ =+ substituteTimeSpecifier (Proxy :: Proxy ZonedTime)+#endif instance FormatTime ZoneSeriesTime where formatCharacter =
LICENSE view
@@ -1,4 +1,4 @@-Copyright (c) 2010-2018 Yitzchak Gale. All rights reserved.+Copyright (c) 2010-2021 Yitzchak Gale. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are
README.md view
@@ -43,7 +43,7 @@ packages for more information about reading and creating Olson timezone files. -Copyright (c) 2010-2018 Yitzchak Gale. All rights reserved.+Copyright (c) 2010-2021 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
timezone-series.cabal view
@@ -1,5 +1,5 @@ Name: timezone-series-Version: 0.1.9+Version: 0.1.13 Synopsis: Enhanced timezone handling for Data.Time Description: This package endows Data.Time, from the time package, with several data types and functions@@ -14,7 +14,7 @@ License-file: LICENSE Author: Yitzchak Gale Maintainer: yitz@sefer.org-Copyright: Copyright (c) 2010-2018 Yitzchak Gale. All rights reserved.+Copyright: Copyright (c) 2010-2021 Yitzchak Gale. All rights reserved. Category: Data Build-type: Simple Extra-source-files: README.md@@ -29,8 +29,7 @@ Default-language: Haskell2010 Hs-source-dirs: . Exposed-modules: Data.Time.LocalTime.TimeZone.Series- Other-modules: Data.Time.LocalTime.TimeZone.Internal.TimeVersion Default-extensions: DeriveDataTypeable Build-depends: base >= 4.4 && < 5 , deepseq- , time (>= 1.1.4 && < 1.9) || (>= 1.9.1 && < 1.10)+ , time (>= 1.1.4 && < 1.9) || (>= 1.9.1 && < 1.13)