@@ -76,7 +76,7 @@ module Data.Aeson
78import Data.Aeson.Encode (encode)
78import Data.Aeson.Encode (encode)
79−import Data.Aeson.Parser.Internal (decodeWith, eitherDecodeWith, json, json')
79+import Data.Aeson.Parser.Internal (decodeWith, eitherDecodeWith, jsonEOF, json, jsonEOF', json')
80import Data.Aeson.Types
80import Data.Aeson.Types
81import qualified Data.ByteString.Lazy as L
81import qualified Data.ByteString.Lazy as L
@@ -87,7 +87,7 @@ import qualified Data.ByteString.Lazy as L
87-- This function parses immediately, but defers conversion. See
87-- This function parses immediately, but defers conversion. See
88-- 'json' for details.
88-- 'json' for details.
89decode :: (FromJSON a) => L.ByteString -> Maybe a
89decode :: (FromJSON a) => L.ByteString -> Maybe a
90−decode = decodeWith json fromJSON
90+decode = decodeWith jsonEOF fromJSON
91{-# INLINE decode #-}
91{-# INLINE decode #-}
93-- | Efficiently deserialize a JSON value from a lazy 'L.ByteString'.
93-- | Efficiently deserialize a JSON value from a lazy 'L.ByteString'.
@@ -97,17 +97,17 @@ decode = decodeWith json fromJSON
97-- This function parses and performs conversion immediately. See
97-- This function parses and performs conversion immediately. See
98-- 'json'' for details.
98-- 'json'' for details.
99decode' :: (FromJSON a) => L.ByteString -> Maybe a
99decode' :: (FromJSON a) => L.ByteString -> Maybe a
100−decode' = decodeWith json' fromJSON
100+decode' = decodeWith jsonEOF' fromJSON
101{-# INLINE decode' #-}
101{-# INLINE decode' #-}
103-- | Like 'decode' but returns an error message when decoding fails.
103-- | Like 'decode' but returns an error message when decoding fails.
104eitherDecode :: (FromJSON a) => L.ByteString -> Either String a
104eitherDecode :: (FromJSON a) => L.ByteString -> Either String a
105−eitherDecode = eitherDecodeWith json fromJSON
105+eitherDecode = eitherDecodeWith jsonEOF fromJSON
106{-# INLINE eitherDecode #-}
106{-# INLINE eitherDecode #-}
108-- | Like 'decode'' but returns an error message when decoding fails.
108-- | Like 'decode'' but returns an error message when decoding fails.
109eitherDecode' :: (FromJSON a) => L.ByteString -> Either String a
109eitherDecode' :: (FromJSON a) => L.ByteString -> Either String a
110−eitherDecode' = eitherDecodeWith json' fromJSON
110+eitherDecode' = eitherDecodeWith jsonEOF' fromJSON
111{-# INLINE eitherDecode' #-}
111{-# INLINE eitherDecode' #-}