@@ -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