on master help sign in
Support time-1.5
2ada2b3Bas van Dijk
Data/Aeson/Types/Instances.hs+4
@@ -71,7 +71,11 @@ import Data.Traversable (traverse)
71import Data.Vector (Vector)
71import Data.Vector (Vector)
72import Data.Word (Word, Word8, Word16, Word32, Word64)
72import Data.Word (Word, Word8, Word16, Word32, Word64)
73import Foreign.Storable (Storable)
73import Foreign.Storable (Storable)
74+#if MIN_VERSION_time(1,5,0)
75+import Data.Time.Format(defaultTimeLocale, dateTimeFmt)
76+#else
74import System.Locale (defaultTimeLocale, dateTimeFmt)
77import System.Locale (defaultTimeLocale, dateTimeFmt)
78+#endif
75import qualified Data.HashMap.Strict as H
79import qualified Data.HashMap.Strict as H
76import qualified Data.HashSet as HashSet
80import qualified Data.HashSet as HashSet
77import qualified Data.IntMap as IntMap
81import qualified Data.IntMap as IntMap
aeson.cabal+11−2
@@ -74,6 +74,12 @@ flag developer
74 default: False
74 default: False
75 manual: True
75 manual: True
76
76
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+
77library
83library
78 exposed-modules:
84 exposed-modules:
79 Data.Aeson
85 Data.Aeson
@@ -102,15 +108,18 @@ library
102 ghc-prim >= 0.2,
108 ghc-prim >= 0.2,
103 hashable >= 1.1.2.0,
109 hashable >= 1.1.2.0,
104 mtl,
110 mtl,
105− old-locale,
106 scientific >= 0.3.1 && < 0.4,
111 scientific >= 0.3.1 && < 0.4,
107 syb,
112 syb,
108 template-haskell >= 2.4,
113 template-haskell >= 2.4,
109 text >= 1.1.1.0,
114 text >= 1.1.1.0,
110− time,
111 unordered-containers >= 0.2.3.0,
115 unordered-containers >= 0.2.3.0,
112 vector >= 0.7.1
116 vector >= 0.7.1
113
117
118+ if flag(old-locale)
119+ build-depends: time < 1.5, old-locale
120+ else
121+ build-depends: time >= 1.5
122+
114 if flag(developer)
123 if flag(developer)
115 ghc-options: -Werror
124 ghc-options: -Werror
116 ghc-prof-options: -auto-all
125 ghc-prof-options: -auto-all