@@ -657,9 +657,9 @@ obj .: key = case H.lookup key obj of
657 Just v -> parseJSON v <?> Key key
657 Just v -> parseJSON v <?> Key key
658{-# INLINE (.:) #-}
658{-# INLINE (.:) #-}
660−-- | Retrieve the value associated with the given key of an 'Object'. The
660+-- | Retrieve the value associated with the given key of an 'Object'. The
661−-- result is 'Nothing' if the key is not present or value is 'Null', or 'empty'
661+-- result is 'Nothing' if the key is not present or if its value is 'Null',
662−-- if the value cannot be converted to the desired type.
662+-- or 'empty' if the value cannot be converted to the desired type.
664-- This accessor is most useful if the key and value can be absent
664-- This accessor is most useful if the key and value can be absent
665-- from an object without affecting its validity. If the key and
665-- from an object without affecting its validity. If the key and
@@ -670,8 +670,12 @@ obj .:? key = case H.lookup key obj of
670 Just v -> parseJSON v <?> Key key
670 Just v -> parseJSON v <?> Key key
671{-# INLINE (.:?) #-}
671{-# INLINE (.:?) #-}
673−-- | Like '.:?', but the resulting parser will fail,
673+-- | Retrieve the value associated with the given key of an 'Object'.
674−-- if the key is present but is 'Null'.
674+-- The result is 'Nothing' if the key is not present or 'empty' if the
675+-- value cannot be converted to the desired type.
677+-- This differs from '.:?' by attempting to parse 'Null' the same as any
678+-- other JSON value, instead of interpreting it as 'Nothing'.
675(.:!) :: (FromJSON a) => Object -> Text -> Parser (Maybe a)
679(.:!) :: (FromJSON a) => Object -> Text -> Parser (Maybe a)
676obj .:! key = case H.lookup key obj of
680obj .:! key = case H.lookup key obj of
677 Nothing -> pure Nothing
681 Nothing -> pure Nothing