@@ -228,7 +228,7 @@ object = Object . H.fromList
228228{-# INLINE object #-}
229229
230230-- | If the inner @Parser@ failed, modify the failure message using the
231−-- provided function. This allows you to create more meaningful error messages.
231+-- provided function. This allows you to create more descriptive error messages.
232232-- For example:
233233--
234234-- > parseJSON (Object o) = modifyFailure
@@ -237,7 +237,4 @@ object = Object . H.fromList
237237--
238238-- Since 0.6.2.0
239239modifyFailure :: (String -> String) -> Parser a -> Parser a
240−modifyFailure f (Parser p) =
241− Parser $ \failure success -> p (modifyFailure' failure) success
242− where
243− modifyFailure' failure original = failure $ f original
240+modifyFailure f (Parser p) = Parser $ \kf -> p (kf . f)