on master help sign in
Fix eitherDecode functions (gh-142)
commit2b9ca169129f55e6365899a9141ddf9768c16e82 authorBryan O'Sullivan <bos@serpentine.com> dateSun 13 Oct 2013, 21:32 (13 years ago) parentadd4758
1 file changed+3−6
Data/Aeson/Parser/Internal.hs+3−6
Data/Aeson/Parser/Internal.hs+3−6
@@ -269,12 +269,9 @@ eitherDecodeWith p to s =
269269eitherDecodeStrictWith :: Parser Value -> (Value -> Result a) -> B.ByteString
270270 -> Either String a
271271eitherDecodeStrictWith p to s =
272− case A.parse p s of
273− A.Done _ v -> case to v of
274− Success a -> Right a
275− Error msg -> Left msg
276− A.Fail _ _ msg -> Left msg
277− A.Partial _ -> Left "incomplete input"
272+ case either Error to (A.parseOnly p s) of
273+ Success a -> Right a
274+ Error msg -> Left msg
278275{-# INLINE eitherDecodeStrictWith #-}
279276
280277-- $lazy