git.iko.soy/typeable/timezone-olson
on master help sign in
8 files changed+28−48
since splitsnapshots
unifiedsplit
.travis.yml−36 Data/Time/LocalTime/TimeZone/Olson.hs+2−2 Data/Time/LocalTime/TimeZone/Olson/Parse.hs+2−2 Data/Time/LocalTime/TimeZone/Olson/Render.hs+2−2 Data/Time/LocalTime/TimeZone/Olson/Types.hs+18−2 LICENSE+1−1 README.md+1−1 timezone-olson.cabal+2−2
.travis.yml−36
@@ -28,42 +28,6 @@ before_cache:
2828
2929matrix:
3030 include:
31− - compiler: "ghc-7.4.1"
32− # env: TEST=--disable-tests BENCH=--disable-benchmarks
33− addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.4.1], sources: [hvr-ghc]}}
34− - compiler: "ghc-7.4.2"
35− # env: TEST=--disable-tests BENCH=--disable-benchmarks
36− addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.4.2], sources: [hvr-ghc]}}
37− - compiler: "ghc-7.6.1"
38− # env: TEST=--disable-tests BENCH=--disable-benchmarks
39− addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.6.1], sources: [hvr-ghc]}}
40− - compiler: "ghc-7.6.2"
41− # env: TEST=--disable-tests BENCH=--disable-benchmarks
42− addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.6.2], sources: [hvr-ghc]}}
43− - compiler: "ghc-7.6.3"
44− # env: TEST=--disable-tests BENCH=--disable-benchmarks
45− addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.6.3], sources: [hvr-ghc]}}
46− - compiler: "ghc-7.8.1"
47− # env: TEST=--disable-tests BENCH=--disable-benchmarks
48− addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.8.1], sources: [hvr-ghc]}}
49− - compiler: "ghc-7.8.2"
50− # env: TEST=--disable-tests BENCH=--disable-benchmarks
51− addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.8.2], sources: [hvr-ghc]}}
52− - compiler: "ghc-7.8.3"
53− # env: TEST=--disable-tests BENCH=--disable-benchmarks
54− addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.8.3], sources: [hvr-ghc]}}
55− - compiler: "ghc-7.8.4"
56− # env: TEST=--disable-tests BENCH=--disable-benchmarks
57− addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.8.4], sources: [hvr-ghc]}}
58− - compiler: "ghc-7.10.1"
59− # env: TEST=--disable-tests BENCH=--disable-benchmarks
60− addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.10.1], sources: [hvr-ghc]}}
61− - compiler: "ghc-7.10.2"
62− # env: TEST=--disable-tests BENCH=--disable-benchmarks
63− addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.10.2], sources: [hvr-ghc]}}
64− - compiler: "ghc-7.10.3"
65− # env: TEST=--disable-tests BENCH=--disable-benchmarks
66− addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.10.3], sources: [hvr-ghc]}}
6731 - compiler: "ghc-8.0.1"
6832 # env: TEST=--disable-tests BENCH=--disable-benchmarks
6933 addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.0.1], sources: [hvr-ghc]}}
Data/Time/LocalTime/TimeZone/Olson.hs+2−2
@@ -1,7 +1,7 @@
11-----------------------------------------------------------------------------
22-- |
33-- Module : Data.Time.LocalTime.TimeZone.Olson
4−-- Copyright : Yitzchak Gale 2010
4+-- Copyright : Yitzchak Gale 2018
55--
66-- Maintainer : Yitzchak Gale <gale@sefer.org>
77-- Portability : portable
@@ -13,7 +13,7 @@
1313-- converting the parsed data into @TimeZoneSeries@ and @TimeZone@
1414-- objects.
1515
16−{- Copyright (c) 2010 Yitzchak Gale. All rights reserved.
16+{- Copyright (c) 2018 Yitzchak Gale. All rights reserved.
1717For licensing information, see the BSD3-style license in the file
1818LICENSE that was originally distributed by the author together with
1919this file. -}
Data/Time/LocalTime/TimeZone/Olson/Parse.hs+2−2
@@ -3,7 +3,7 @@
33-----------------------------------------------------------------------------
44-- |
55-- Module : Data.Time.LocalTime.TimeZone.Olson.Parse
6−-- Copyright : Yitzchak Gale 2010
6+-- Copyright : Yitzchak Gale 2018
77--
88-- Maintainer : Yitzchak Gale <gale@sefer.org>
99-- Portability : portable
@@ -14,7 +14,7 @@
1414-- <http://www.twinsun.com/tz/tz-link.htm>. Functions are provided for
1515-- converting the parsed data into 'TimeZoneSeries' objects.
1616
17−{- Copyright (c) 2010 Yitzchak Gale. All rights reserved.
17+{- Copyright (c) 2018 Yitzchak Gale. All rights reserved.
1818For licensing information, see the BSD3-style license in the file
1919LICENSE that was originally distributed by the author together with
2020this file. -}
Data/Time/LocalTime/TimeZone/Olson/Render.hs+2−2
@@ -2,7 +2,7 @@
22-----------------------------------------------------------------------------
33-- |
44-- Module : Data.Time.LocalTime.TimeZone.Olson.Render
5−-- Copyright : Yitzchak Gale 2010
5+-- Copyright : Yitzchak Gale 2018
66--
77-- Maintainer : Yitzchak Gale <gale@sefer.org>
88-- Portability : portable
@@ -12,7 +12,7 @@
1212-- Unix-like systems. For more information about this format, see
1313-- <http://www.twinsun.com/tz/tz-link.htm>.
1414
15−{- Copyright (c) 2010 Yitzchak Gale. All rights reserved.
15+{- Copyright (c) 2018ZZ Yitzchak Gale. All rights reserved.
1616For licensing information, see the BSD3-style license in the file
1717LICENSE that was originally distributed by the author together with
1818this file. -}
Data/Time/LocalTime/TimeZone/Olson/Types.hs+18−2
@@ -1,8 +1,9 @@
11{-# OPTIONS_HADDOCK hide #-}
2+{-# LANGUAGE CPP #-}
23-----------------------------------------------------------------------------
34-- |
45-- Module : Data.Time.LocalTime.TimeZone.Olson.Types
5−-- Copyright : Yitzchak Gale 2010
6+-- Copyright : Yitzchak Gale 2018
67--
78-- Maintainer : Yitzchak Gale <gale@sefer.org>
89-- Portability : portable
@@ -14,7 +15,7 @@
1415--
1516-- Both Version 1 and Version 2 timezone data can be represented.
1617
17−{- Copyright (c) 2010 Yitzchak Gale. All rights reserved.
18+{- Copyright (c) 2018 Yitzchak Gale. All rights reserved.
1819For licensing information, see the BSD3-style license in the file
1920LICENSE that was originally distributed by the author together with
2021this file. -}
@@ -36,6 +37,9 @@ module Data.Time.LocalTime.TimeZone.Olson.Types
3637)
3738where
3839
40+#if MIN_VERSION_base(4,11,0)
41+import Data.Semigroup (Semigroup(..))
42+#endif
3943import Data.Monoid (Monoid(..))
4044import Control.Monad (mplus)
4145
@@ -71,6 +75,17 @@ data OlsonData =
7175 }
7276 deriving (Eq, Show)
7377
78+#if MIN_VERSION_base(4,11,0)
79+instance Semigroup OlsonData where
80+ OlsonData a b c d <> OlsonData a' b' c' d' =
81+ OlsonData (a ++ map (shiftBy $ length b) a')
82+ (b ++ b') (c ++ c') (d `mplus` d')
83+ where
84+ shiftBy n trans = trans {transIndex = n + transIndex trans}
85+
86+instance Monoid OlsonData where
87+ mempty = OlsonData [] [] [] Nothing
88+#else
7489instance Monoid OlsonData where
7590 mempty = OlsonData [] [] [] Nothing
7691 mappend (OlsonData a b c d ) (OlsonData a' b' c' d') =
@@ -78,6 +93,7 @@ instance Monoid OlsonData where
7893 (b ++ b') (c ++ c') (d `mplus` d')
7994 where
8095 shiftBy n trans = trans {transIndex = n + transIndex trans}
96+#endif
8197
8298-- | A @Transition@ represents a moment when the clocks change in a
8399-- timezone. It consists of a Unix timestamp value that indicates the
LICENSE+1−1
@@ -1,4 +1,4 @@
1−Copyright (c) 2010-2017 Yitzchak Gale. All rights reserved.
1+Copyright (c) 2010-2018 Yitzchak Gale. All rights reserved.
22
33Redistribution and use in source and binary forms, with or without
44modification, are permitted provided that the following conditions are
README.md+1−1
@@ -19,7 +19,7 @@ See also the
1919package for a way to include timezone informaton from a binary Olson
2020timezone file at compile time.
2121
22−Copyright (c) 2010-2017 Yitzchak Gale. All rights reserved.
22+Copyright (c) 2010-2018 Yitzchak Gale. All rights reserved.
2323
2424For licensing information, see the BSD3-style license in the file
2525LICENSE that was originally distributed by the author together with
timezone-olson.cabal+2−2
@@ -1,5 +1,5 @@
11Name: timezone-olson
2−Version: 0.1.8
2+Version: 0.1.9
33Synopsis: A pure Haskell parser and renderer for binary Olson timezone files
44Description: A parser and renderer for binary Olson timezone
55 files whose format is specified by the tzfile(5)
@@ -25,7 +25,7 @@ Category: Data
2525Build-type: Simple
2626Extra-source-files: README.md, catTZ.hs, hzdump.hs
2727Cabal-version: >=1.10
28−Tested-with: GHC > 7.4 && < 8.5
28+Tested-with: GHC > 8.0 && < 8.5
2929
3030Source-repository HEAD
3131 type: git