@@ -63,9 +63,9 @@ module Data.Aeson.Types.FromJSON
63 , parseField
63 , parseField
64 , parseFieldMaybe
64 , parseFieldMaybe
65 , parseFieldMaybe'
65 , parseFieldMaybe'
66− , liftParseField
66+ , explicitParseField
67− , liftParseFieldMaybe
67+ , explicitParseFieldMaybe
68− , liftParseFieldMaybe'
68+ , explicitParseFieldMaybe'
69 -- ** Operators
69 -- ** Operators
@@ -661,7 +661,7 @@ ifromJSON = iparse parseJSON
661-- in an object for it to be valid. If the key and value are
661-- in an object for it to be valid. If the key and value are
662-- optional, use '.:?' instead.
662-- optional, use '.:?' instead.
663(.:) :: (FromJSON a) => Object -> Text -> Parser a
663(.:) :: (FromJSON a) => Object -> Text -> Parser a
664−(.:) = liftParseField parseJSON
664+(.:) = explicitParseField parseJSON
665{-# INLINE (.:) #-}
665{-# INLINE (.:) #-}
667-- | Retrieve the value associated with the given key of an 'Object'. The
667-- | Retrieve the value associated with the given key of an 'Object'. The
@@ -672,7 +672,7 @@ ifromJSON = iparse parseJSON
672-- from an object without affecting its validity. If the key and
672-- from an object without affecting its validity. If the key and
673-- value are mandatory, use '.:' instead.
673-- value are mandatory, use '.:' instead.
674(.:?) :: (FromJSON a) => Object -> Text -> Parser (Maybe a)
674(.:?) :: (FromJSON a) => Object -> Text -> Parser (Maybe a)
675−(.:?) = liftParseFieldMaybe parseJSON
675+(.:?) = explicitParseFieldMaybe parseJSON
676{-# INLINE (.:?) #-}
676{-# INLINE (.:?) #-}
678-- | Retrieve the value associated with the given key of an 'Object'.
678-- | Retrieve the value associated with the given key of an 'Object'.
@@ -682,7 +682,7 @@ ifromJSON = iparse parseJSON
682-- This differs from '.:?' by attempting to parse 'Null' the same as any
682-- This differs from '.:?' by attempting to parse 'Null' the same as any
683-- other JSON value, instead of interpreting it as 'Nothing'.
683-- other JSON value, instead of interpreting it as 'Nothing'.
684(.:!) :: (FromJSON a) => Object -> Text -> Parser (Maybe a)
684(.:!) :: (FromJSON a) => Object -> Text -> Parser (Maybe a)
685−(.:!) = liftParseFieldMaybe' parseJSON
685+(.:!) = explicitParseFieldMaybe' parseJSON
686{-# INLINE (.:!) #-}
686{-# INLINE (.:!) #-}
688-- | Function variant of '.:'.
688-- | Function variant of '.:'.
@@ -702,26 +702,26 @@ parseFieldMaybe' = (.:!)
703-- | Variant of '.:' with explicit parser function.
703-- | Variant of '.:' with explicit parser function.
705−-- E.g. @'liftParseField' 'parseJSON1' :: ('FromJSON1' f, 'FromJSON' a) -> 'Object' -> 'Text' -> 'Parser' (f a)@
705+-- E.g. @'explicitParseField' 'parseJSON1' :: ('FromJSON1' f, 'FromJSON' a) -> 'Object' -> 'Text' -> 'Parser' (f a)@
706−liftParseField :: (Value -> Parser a) -> Object -> Text -> Parser a
706+explicitParseField :: (Value -> Parser a) -> Object -> Text -> Parser a
707−liftParseField p obj key = case H.lookup key obj of
707+explicitParseField p obj key = case H.lookup key obj of
708 Nothing -> fail $ "key " ++ show key ++ " not present"
708 Nothing -> fail $ "key " ++ show key ++ " not present"
709 Just v -> p v <?> Key key
709 Just v -> p v <?> Key key
710−{-# INLINE liftParseField #-}
710+{-# INLINE explicitParseField #-}
712-- | Variant of '.:?' with explicit parser function.
712-- | Variant of '.:?' with explicit parser function.
713−liftParseFieldMaybe :: (Value -> Parser a) -> Object -> Text -> Parser (Maybe a)
713+explicitParseFieldMaybe :: (Value -> Parser a) -> Object -> Text -> Parser (Maybe a)
714−liftParseFieldMaybe p obj key = case H.lookup key obj of
714+explicitParseFieldMaybe p obj key = case H.lookup key obj of
715 Nothing -> pure Nothing
715 Nothing -> pure Nothing
716 Just v -> liftParseJSON p (listParser p) v <?> Key key -- listParser isn't used by maybe instance.
716 Just v -> liftParseJSON p (listParser p) v <?> Key key -- listParser isn't used by maybe instance.
717−{-# INLINE liftParseFieldMaybe #-}
717+{-# INLINE explicitParseFieldMaybe #-}
719-- | Variant of '.:!' with explicit parser function.
719-- | Variant of '.:!' with explicit parser function.
720−liftParseFieldMaybe' :: (Value -> Parser a) -> Object -> Text -> Parser (Maybe a)
720+explicitParseFieldMaybe' :: (Value -> Parser a) -> Object -> Text -> Parser (Maybe a)
721−liftParseFieldMaybe' p obj key = case H.lookup key obj of
721+explicitParseFieldMaybe' p obj key = case H.lookup key obj of
722 Nothing -> pure Nothing
722 Nothing -> pure Nothing
723 Just v -> Just <$> p v <?> Key key
723 Just v -> Just <$> p v <?> Key key
724−{-# INLINE liftParseFieldMaybe' #-}
724+{-# INLINE explicitParseFieldMaybe' #-}
726-- | Helper for use in combination with '.:?' to provide default
726-- | Helper for use in combination with '.:?' to provide default
727-- values for optional JSON object fields.
727-- values for optional JSON object fields.