@@ -76,7 +76,7 @@ module Data.Aeson
7676 ) where
7777
7878import 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')
8080import Data.Aeson.Types
8181import qualified Data.ByteString.Lazy as L
8282
@@ -87,7 +87,7 @@ import qualified Data.ByteString.Lazy as L
8787-- This function parses immediately, but defers conversion. See
8888-- 'json' for details.
8989decode :: (FromJSON a) => L.ByteString -> Maybe a
90−decode = decodeWith json fromJSON
90+decode = decodeWith jsonEOF fromJSON
9191{-# INLINE decode #-}
9292
9393-- | Efficiently deserialize a JSON value from a lazy 'L.ByteString'.
@@ -97,17 +97,17 @@ decode = decodeWith json fromJSON
9797-- This function parses and performs conversion immediately. See
9898-- 'json'' for details.
9999decode' :: (FromJSON a) => L.ByteString -> Maybe a
100−decode' = decodeWith json' fromJSON
100+decode' = decodeWith jsonEOF' fromJSON
101101{-# INLINE decode' #-}
102102
103103-- | Like 'decode' but returns an error message when decoding fails.
104104eitherDecode :: (FromJSON a) => L.ByteString -> Either String a
105−eitherDecode = eitherDecodeWith json fromJSON
105+eitherDecode = eitherDecodeWith jsonEOF fromJSON
106106{-# INLINE eitherDecode #-}
107107
108108-- | Like 'decode'' but returns an error message when decoding fails.
109109eitherDecode' :: (FromJSON a) => L.ByteString -> Either String a
110−eitherDecode' = eitherDecodeWith json' fromJSON
110+eitherDecode' = eitherDecodeWith jsonEOF' fromJSON
111111{-# INLINE eitherDecode' #-}
112112
113113-- $use