@@ -164,8 +164,8 @@ parseIndexedJSONPair keyParser valParser idx value = p value <?> Index idx
164 p = withArray "(k,v)" $ \ab ->
164 p = withArray "(k,v)" $ \ab ->
165 let n = V.length ab
165 let n = V.length ab
166 in if n == 2
166 in if n == 2
167− then (,) <$> parseJSONElemAtIndex keyParser 0 ab
167+ then (,) <$> parseJSONElemAtIndex keyParser 0 ab
168− <*> parseJSONElemAtIndex valParser 1 ab
168+ <*>+ parseJSONElemAtIndex valParser 1 ab
169 else fail $ "cannot unpack array of length " ++
169 else fail $ "cannot unpack array of length " ++
170 show n ++ " into a pair"
170 show n ++ " into a pair"
171{-# INLINE parseIndexedJSONPair #-}
171{-# INLINE parseIndexedJSONPair #-}
@@ -606,7 +606,7 @@ parseJSON2 = liftParseJSON2 parseJSON parseJSONList parseJSON parseJSONList
607-- | Helper function to use with 'liftParseJSON'. See 'Data.Aeson.ToJSON.listEncoding'.
607-- | Helper function to use with 'liftParseJSON'. See 'Data.Aeson.ToJSON.listEncoding'.
608listParser :: (Value -> Parser a) -> Value -> Parser [a]
608listParser :: (Value -> Parser a) -> Value -> Parser [a]
609−listParser f (Array xs) = fmap V.toList (V.mapM f xs)
609+listParser f (Array xs) = fmap V.toList (accumulateTraverseVector f xs)
610listParser _ v = typeMismatch "[a]" v
610listParser _ v = typeMismatch "[a]" v
611{-# INLINE listParser #-}
611{-# INLINE listParser #-}
@@ -1529,7 +1529,7 @@ instance (FromJSON1 f, FromJSON1 g, FromJSON a) => FromJSON (Sum f g a) where
1529instance FromJSON1 Seq.Seq where
1529instance FromJSON1 Seq.Seq where
1530 liftParseJSON p _ = withArray "Seq a" $
1530 liftParseJSON p _ = withArray "Seq a" $
1531 fmap Seq.fromList .
1531 fmap Seq.fromList .
1532− Tr.sequence . zipWith (parseIndexedJSON p) [0..] . V.toList
1532+ accumulateSequenceList . zipWith (parseIndexedJSON p) [0..] . V.toList
1533 {-# INLINE liftParseJSON #-}
1533 {-# INLINE liftParseJSON #-}
1535instance (FromJSON a) => FromJSON (Seq.Seq a) where
1535instance (FromJSON a) => FromJSON (Seq.Seq a) where
@@ -1607,7 +1607,7 @@ instance FromJSONKey UUID.UUID where
1608instance FromJSON1 Vector where
1608instance FromJSON1 Vector where
1609 liftParseJSON p _ = withArray "Vector a" $
1609 liftParseJSON p _ = withArray "Vector a" $
1610− V.mapM (uncurry $ parseIndexedJSON p) . V.indexed
1610+ accumulateTraverseVector (uncurry $ parseIndexedJSON p) . V.indexed
1611 {-# INLINE liftParseJSON #-}
1611 {-# INLINE liftParseJSON #-}
1613instance (FromJSON a) => FromJSON (Vector a) where
1613instance (FromJSON a) => FromJSON (Vector a) where