-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | This package endows Data.Time, from the time package, with several
--   data types and functions for enhanced processing of timezones. For one
--   way to create timezone series, see the timezone-olson
--   (<a>http://hackage.haskell.org/package/timezone-olson</a>) and
--   timezone-olson-th
--   (<a>http://hackage.haskell.org/package/timezone-olson-th</a>)
--   packages.
@package timezone-series
@version 0.1.13


-- | A <tt>TimeZoneSeries</tt> describes a timezone by specifying the
--   various clock settings that occurred in the past and are scheduled to
--   occur in the future for the timezone.
module Data.Time.LocalTime.TimeZone.Series

-- | A <tt>TimeZoneSeries</tt> consists of a default <tt>TimeZone</tt>
--   object and a sequence of pairs of a <tt>UTCTime</tt> and a
--   <tt>TimeZone</tt> object. Each <tt>UTCTime</tt> indicates a moment at
--   which the clocks changed, and the corresponding <tt>TimeZone</tt>
--   object describes the new state of the clocks after the change. The
--   default <tt>TimeZone</tt> object is used for times preceding the
--   earliest <tt>UTCTime</tt>, or if the sequence of pairs is empty. The
--   times in the sequence are in order from latest to earlist (note that
--   this is the opposite of the way that they are stored in an Olson
--   timezone file).
data TimeZoneSeries
TimeZoneSeries :: TimeZone -> [(UTCTime, TimeZone)] -> TimeZoneSeries

-- | The default timezone state
[tzsTimeZone] :: TimeZoneSeries -> TimeZone

-- | A list of pairs of the time of a change of clocks and the new timezone
--   state after the change
[tzsTransitions] :: TimeZoneSeries -> [(UTCTime, TimeZone)]

-- | Given a timezone represented by a <tt>TimeZoneSeries</tt>, and a
--   <tt>UTCTime</tt>, provide the state of the timezone's clocks at that
--   time.
timeZoneFromSeries :: TimeZoneSeries -> UTCTime -> TimeZone

-- | When a clock change moves the clock forward, local times that are
--   between the wall clock time before the change and the wall clock time
--   after the change cannot occur.
isValidLocalTime :: TimeZoneSeries -> LocalTime -> Bool

-- | When a clock change moves the clock backward, local times that are
--   between the wall clock time before the change and the wall clock time
--   after the change occur twice.
isRedundantLocalTime :: TimeZoneSeries -> LocalTime -> Bool

-- | The latest non-summer <tt>TimeZone</tt> in a <tt>TimeZoneSeries</tt>
--   is in some sense representative of the timezone.
latestNonSummer :: TimeZoneSeries -> TimeZone

-- | Convert a UTC time to local time using the <a>TimeZone</a> that is in
--   effect at that time in the timezone represented by TimeZoneSeries.
utcToLocalTime' :: TimeZoneSeries -> UTCTime -> LocalTime

-- | Convert a local time to UTC using the <a>TimeZone</a> that is in
--   effect at that time in the timezone represented by TimeZoneSeries.
--   Local times that are invalid or redundant are treated as described
--   above.
localTimeToUTC' :: TimeZoneSeries -> LocalTime -> UTCTime

-- | A <tt>ZoneSeriesTime</tt> represents a moment of time in the context
--   of a particular timezone.
data ZoneSeriesTime
ZoneSeriesTime :: UTCTime -> TimeZoneSeries -> ZoneSeriesTime
[zoneSeriesTimeToUTC] :: ZoneSeriesTime -> UTCTime
[zoneSeriesTimeSeries] :: ZoneSeriesTime -> TimeZoneSeries

-- | Use a trivial <tt>TimeZoneSeries</tt> containing only the
--   <tt>TimeZone</tt> of the <tt>ZonedTime</tt>, and use it to define a
--   <tt>ZoneSeriesTime</tt>.
zonedTimeToZoneSeriesTime :: ZonedTime -> ZoneSeriesTime

-- | The local time represented by a <tt>ZoneSeriesTime</tt>
zoneSeriesTimeToLocalTime :: ZoneSeriesTime -> LocalTime

-- | The <tt>TimeZone</tt> that is in effect at the moment represented by a
--   <tt>ZoneSeriesTime</tt>.
zoneSeriesTimeZone :: ZoneSeriesTime -> TimeZone

-- | The <tt>ZoneSeriesTime</tt> that represents the given local time in
--   the given timezone. Local times that are invalid or redundant are
--   treated as described below.
localTimeToZoneSeriesTime :: TimeZoneSeries -> LocalTime -> ZoneSeriesTime
instance GHC.Classes.Eq Data.Time.LocalTime.TimeZone.Series.TimeZoneSeries
instance GHC.Classes.Eq Data.Time.LocalTime.TimeZone.Series.ZoneSeriesTime
instance Data.Time.Format.Format.Class.FormatTime Data.Time.LocalTime.TimeZone.Series.TimeZoneSeries
instance Data.Time.Format.Format.Class.FormatTime Data.Time.LocalTime.TimeZone.Series.ZoneSeriesTime
instance Control.DeepSeq.NFData Data.Time.LocalTime.TimeZone.Series.TimeZoneSeries
instance GHC.Classes.Ord Data.Time.LocalTime.TimeZone.Series.TimeZoneSeries
instance GHC.Classes.Ord Data.Time.LocalTime.TimeZone.Series.ZoneSeriesTime
instance Data.Time.Format.Parse.Class.ParseTime Data.Time.LocalTime.TimeZone.Series.TimeZoneSeries
instance Data.Time.Format.Parse.Class.ParseTime Data.Time.LocalTime.TimeZone.Series.ZoneSeriesTime
instance GHC.Internal.Read.Read Data.Time.LocalTime.TimeZone.Series.TimeZoneSeries
instance GHC.Internal.Read.Read Data.Time.LocalTime.TimeZone.Series.ZoneSeriesTime
instance GHC.Internal.Show.Show Data.Time.LocalTime.TimeZone.Series.TimeZoneSeries
instance GHC.Internal.Show.Show Data.Time.LocalTime.TimeZone.Series.ZoneSeriesTime
