@@ -63,9 +63,9 @@ module Data.Aeson.Types.FromJSON
6363 , parseField
6464 , parseFieldMaybe
6565 , parseFieldMaybe'
66− , liftParseField
67− , liftParseFieldMaybe
68− , liftParseFieldMaybe'
66+ , explicitParseField
67+ , explicitParseFieldMaybe
68+ , explicitParseFieldMaybe'
6969 -- ** Operators
7070 , (.:)
7171 , (.:?)
@@ -661,7 +661,7 @@ ifromJSON = iparse parseJSON
661661-- in an object for it to be valid. If the key and value are
662662-- optional, use '.:?' instead.
663663(.:) :: (FromJSON a) => Object -> Text -> Parser a
664−(.:) = liftParseField parseJSON
664+(.:) = explicitParseField parseJSON
665665{-# INLINE (.:) #-}
666666
667667-- | Retrieve the value associated with the given key of an 'Object'. The
@@ -672,7 +672,7 @@ ifromJSON = iparse parseJSON
672672-- from an object without affecting its validity. If the key and
673673-- value are mandatory, use '.:' instead.
674674(.:?) :: (FromJSON a) => Object -> Text -> Parser (Maybe a)
675−(.:?) = liftParseFieldMaybe parseJSON
675+(.:?) = explicitParseFieldMaybe parseJSON
676676{-# INLINE (.:?) #-}
677677
678678-- | Retrieve the value associated with the given key of an 'Object'.
@@ -682,7 +682,7 @@ ifromJSON = iparse parseJSON
682682-- This differs from '.:?' by attempting to parse 'Null' the same as any
683683-- other JSON value, instead of interpreting it as 'Nothing'.
684684(.:!) :: (FromJSON a) => Object -> Text -> Parser (Maybe a)
685−(.:!) = liftParseFieldMaybe' parseJSON
685+(.:!) = explicitParseFieldMaybe' parseJSON
686686{-# INLINE (.:!) #-}
687687
688688-- | Function variant of '.:'.
@@ -702,26 +702,26 @@ parseFieldMaybe' = (.:!)
702702
703703-- | Variant of '.:' with explicit parser function.
704704--
705−-- E.g. @'liftParseField' 'parseJSON1' :: ('FromJSON1' f, 'FromJSON' a) -> 'Object' -> 'Text' -> 'Parser' (f a)@
706−liftParseField :: (Value -> Parser a) -> Object -> Text -> Parser a
707−liftParseField p obj key = case H.lookup key obj of
705+-- E.g. @'explicitParseField' 'parseJSON1' :: ('FromJSON1' f, 'FromJSON' a) -> 'Object' -> 'Text' -> 'Parser' (f a)@
706+explicitParseField :: (Value -> Parser a) -> Object -> Text -> Parser a
707+explicitParseField p obj key = case H.lookup key obj of
708708 Nothing -> fail $ "key " ++ show key ++ " not present"
709709 Just v -> p v <?> Key key
710−{-# INLINE liftParseField #-}
710+{-# INLINE explicitParseField #-}
711711
712712-- | Variant of '.:?' with explicit parser function.
713−liftParseFieldMaybe :: (Value -> Parser a) -> Object -> Text -> Parser (Maybe a)
714−liftParseFieldMaybe p obj key = case H.lookup key obj of
713+explicitParseFieldMaybe :: (Value -> Parser a) -> Object -> Text -> Parser (Maybe a)
714+explicitParseFieldMaybe p obj key = case H.lookup key obj of
715715 Nothing -> pure Nothing
716716 Just v -> liftParseJSON p (listParser p) v <?> Key key -- listParser isn't used by maybe instance.
717−{-# INLINE liftParseFieldMaybe #-}
717+{-# INLINE explicitParseFieldMaybe #-}
718718
719719-- | Variant of '.:!' with explicit parser function.
720−liftParseFieldMaybe' :: (Value -> Parser a) -> Object -> Text -> Parser (Maybe a)
721−liftParseFieldMaybe' p obj key = case H.lookup key obj of
720+explicitParseFieldMaybe' :: (Value -> Parser a) -> Object -> Text -> Parser (Maybe a)
721+explicitParseFieldMaybe' p obj key = case H.lookup key obj of
722722 Nothing -> pure Nothing
723723 Just v -> Just <$> p v <?> Key key
724−{-# INLINE liftParseFieldMaybe' #-}
724+{-# INLINE explicitParseFieldMaybe' #-}
725725
726726-- | Helper for use in combination with '.:?' to provide default
727727-- values for optional JSON object fields.