@@ -117,6 +117,7 @@ import Control.Applicative ( (<|>), (<$>), pure, (*>), (<*) )
117import Control.Concurrent.MVar (MVar, newMVar)
117import Control.Concurrent.MVar (MVar, newMVar)
118import Control.Exception (Exception)
118import Control.Exception (Exception)
119import qualified Data.Aeson as JSON
119import qualified Data.Aeson as JSON
120+import qualified Data.Aeson.Internal as JSON
120import qualified Data.Aeson.Parser as JSON (value')
121import qualified Data.Aeson.Parser as JSON (value')
121import Data.Attoparsec.ByteString.Char8 hiding (Result)
122import Data.Attoparsec.ByteString.Char8 hiding (Result)
122import Data.ByteString (ByteString)
123import Data.ByteString (ByteString)
@@ -567,7 +568,7 @@ fromFieldJSONByteString f mbs =
567 Just bs -> pure bs
568 Just bs -> pure bs
569-- | Parse a field to a JSON 'JSON.Value' and convert that into a
570-- | Parse a field to a JSON 'JSON.Value' and convert that into a
570−-- Haskell value using 'JSON.fromJSON'.
571+-- Haskell value using the 'JSON.FromJSON' instance.
572-- This can be used as the default implementation for the 'fromField'
573-- This can be used as the default implementation for the 'fromField'
573-- method for Haskell types that have a JSON representation in
574-- method for Haskell types that have a JSON representation in
@@ -588,10 +589,10 @@ fromFieldJSONByteString f mbs =
588fromJSONField :: (JSON.FromJSON a, Typeable a) => FieldParser a
589fromJSONField :: (JSON.FromJSON a, Typeable a) => FieldParser a
589fromJSONField f mbBs = do
590fromJSONField f mbBs = do
590 value <- fromField f mbBs
591 value <- fromField f mbBs
591− case JSON.fromJSON value of
592+ case JSON.ifromJSON value of
592− JSON.Error err -> returnError ConversionFailed f $
593+ JSON.IError path err -> returnError ConversionFailed f $
593− "JSON decoding error: " ++ err
594+ "JSON decoding error: " ++ (JSON.formatError path err)
594− JSON.Success x -> pure x
595+ JSON.ISuccess x -> pure x
596-- | Compatible with the same set of types as @a@. Note that
597-- | Compatible with the same set of types as @a@. Note that
597-- modifying the 'IORef' does not have any effects outside
598-- modifying the 'IORef' does not have any effects outside