Skip to content

Commit

Permalink
Fix documentation of .:!=
Browse files Browse the repository at this point in the history
I think this bit belongs in `.:?=`, by analogy with `.:!` and `.:?`.
  • Loading branch information
michaelpj committed Jan 17, 2024
1 parent d48c826 commit 8314247
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Data/Aeson/Types/FromJSON.hs
Original file line number Diff line number Diff line change
Expand Up @@ -865,15 +865,15 @@ ifromJSON = iparse parseJSON
(.:!) = explicitParseFieldMaybe' parseJSON

-- | Retrieve the value associated with the given key of an 'Object'.
-- If the key is not present and the 'omittedField' is @'Just' x@ for some @x@,
-- If the key is not present or the field is @null@ and the 'omittedField' is @'Just' x@ for some @x@,
-- the result will be that @x@.
--
-- @since 2.2.0.0
(.:?=) :: (FromJSON a) => Object -> Key -> Parser a
(.:?=) = explicitParseFieldOmit omittedField parseJSON

-- | Retrieve the value associated with the given key of an 'Object'.
-- If the key is not present or the field is @null@ and the 'omittedField' is @'Just' x@ for some @x@,
-- If the key is not present and the 'omittedField' is @'Just' x@ for some @x@,
-- the result will be that @x@.
--
-- This differs from '.:?=' by attempting to parse 'Null' the same as any
Expand Down

0 comments on commit 8314247

Please sign in to comment.