Skip to content
Browse files

Merge pull request #168 from mkscrg/decodeStrict-fix

Fix "incomplete input" from decodeStrictWith
  • Loading branch information...
2 parents ce36f22 + dcc7019 commit 3101c932c088c0486cc9c4269b5c926605e6fdcd @bos committed Jan 2, 2014
Showing with 3 additions and 5 deletions.
  1. +3 −5 Data/Aeson/Parser/Internal.hs
View
8 Data/Aeson/Parser/Internal.hs
@@ -279,11 +279,9 @@ decodeWith p to s =
decodeStrictWith :: Parser Value -> (Value -> Result a) -> B.ByteString
-> Maybe a
decodeStrictWith p to s =
- case A.parse p s of
- A.Done _ v -> case to v of
- Success a -> Just a
- _ -> Nothing
- _ -> Nothing
+ case either Error to (A.parseOnly p s) of
+ Success a -> Just a
+ Error _ -> Nothing
{-# INLINE decodeStrictWith #-}
eitherDecodeWith :: Parser Value -> (Value -> Result a) -> L.ByteString

0 comments on commit 3101c93

Please sign in to comment.
Something went wrong with that request. Please try again.