on master help sign in
Relax dependency on attoparsec

This allows us to work with the version of the Haskell Platform that is current as of early 2014.

commit7f0d1a989cc914a5064a68d8f99a17cd66535417 authorBryan O'Sullivan <bos@serpentine.com> dateMon 3 Feb 2014, 22:40 (13 years ago) parent44ba006
2 files changed+11−4
Data/Aeson/Parser/Internal.hs+10−3 aeson.cabal+1−1
Data/Aeson/Parser/Internal.hs+10−3
@@ -133,7 +133,7 @@ array_' = {-# SCC "array_'" #-} do
133133
134134commaSeparated :: Parser a -> Word8 -> Parser [a]
135135commaSeparated item endByte = do
136− w <- A.peekWord8'
136+ w <- peekWord8'
137137 if w == endByte
138138 then A.anyWord8 >> return []
139139 else loop
@@ -164,7 +164,7 @@ arrayValues val = do
164164-- to preserve interoperability and security.
165165value :: Parser Value
166166value = do
167− w <- A.peekWord8'
167+ w <- peekWord8'
168168 case w of
169169 DOUBLE_QUOTE -> A.anyWord8 *> (String <$> jstring_)
170170 OPEN_CURLY -> A.anyWord8 *> object_
@@ -179,7 +179,7 @@ value = do
179179-- | Strict version of 'value'. See also 'json''.
180180value' :: Parser Value
181181value' = do
182− w <- A.peekWord8'
182+ w <- peekWord8'
183183 case w of
184184 DOUBLE_QUOTE -> do
185185 !s <- A.anyWord8 *> jstring_
@@ -349,3 +349,10 @@ toByteString :: Builder -> ByteString
349349toByteString = L.toStrict . toLazyByteString
350350{-# INLINE toByteString #-}
351351#endif
352+
353+peekWord8' :: A.Parser Word8
354+#if MIN_VERSION_attoparsec(0,11,1)
355+peekWord8' = A.peekWord8'
356+#else
357+peekWord8' = maybe (fail "not enough bytes") return =<< A.peekWord8
358+#endif
aeson.cabal+1−1
@@ -112,7 +112,7 @@ library
112112 Data.Aeson.Types.Generic
113113
114114 build-depends:
115− attoparsec >= 0.11.1.0,
115+ attoparsec >= 0.10.2.1,
116116 base == 4.*,
117117 containers,
118118 deepseq,