Source

aeson / Data / Aeson / Types / Internal.hs

The default branch has multiple heads

Diff from to

File Data/Aeson/Types/Internal.hs

 {-# INLINE object #-}
 
 -- | If the inner @Parser@ failed, modify the failure message using the
--- provided function. This allows you to create more meaningful error messages.
+-- provided function. This allows you to create more descriptive error messages.
 -- For example:
 --
 -- > parseJSON (Object o) = modifyFailure
 --
 -- Since 0.6.2.0
 modifyFailure :: (String -> String) -> Parser a -> Parser a
-modifyFailure f (Parser p) =
-    Parser $ \failure success -> p (modifyFailure' failure) success
-  where
-    modifyFailure' failure original = failure $ f original
+modifyFailure f (Parser p) = Parser $ \kf -> p (kf . f)