on master help sign in
Support time-1.5
commit2ada2b308daef5ea3d0bf35e5668cc5a6ac05c32 authorBas van Dijk <v.dijk.bas@gmail.com> dateFri 19 Sep 2014, 10:58 (12 years ago) parent469c143
2 files changed+15−2
Data/Aeson/Types/Instances.hs+4 aeson.cabal+11−2
Data/Aeson/Types/Instances.hs+4
@@ -71,7 +71,11 @@ import Data.Traversable (traverse)
7171import Data.Vector (Vector)
7272import Data.Word (Word, Word8, Word16, Word32, Word64)
7373import Foreign.Storable (Storable)
74+#if MIN_VERSION_time(1,5,0)
75+import Data.Time.Format(defaultTimeLocale, dateTimeFmt)
76+#else
7477import System.Locale (defaultTimeLocale, dateTimeFmt)
78+#endif
7579import qualified Data.HashMap.Strict as H
7680import qualified Data.HashSet as HashSet
7781import qualified Data.IntMap as IntMap
aeson.cabal+11−2
@@ -74,6 +74,12 @@ flag developer
7474 default: False
7575 manual: True
7676
77+flag old-locale
78+ description: If false then depend on time >= 1.5.
79+ .
80+ If true then depend on time < 1.5 together with old-locale.
81+ default: False
82+
7783library
7884 exposed-modules:
7985 Data.Aeson
@@ -102,15 +108,18 @@ library
102108 ghc-prim >= 0.2,
103109 hashable >= 1.1.2.0,
104110 mtl,
105− old-locale,
106111 scientific >= 0.3.1 && < 0.4,
107112 syb,
108113 template-haskell >= 2.4,
109114 text >= 1.1.1.0,
110− time,
111115 unordered-containers >= 0.2.3.0,
112116 vector >= 0.7.1
113117
118+ if flag(old-locale)
119+ build-depends: time < 1.5, old-locale
120+ else
121+ build-depends: time >= 1.5
122+
114123 if flag(developer)
115124 ghc-options: -Werror
116125 ghc-prof-options: -auto-all