Skip to content

Created additional getFieldOptional #36

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

Vlix
Copy link

@Vlix Vlix commented Aug 29, 2017

Ran into problems using (.??) because it doesn't behave as expected if you're familiar with the Haskell Data.Aeson library.
If the operator alias of the original getFieldOptional shouldn't change, use (.?!) for the new one.
Maybe also change the name if getFieldOptional' isn't clear enough.

Vlix added 2 commits August 29, 2017 18:21
The regular getFieldOptional doesn't return Nothing when the value of the field is null.
getFieldOptional' does give Nothing when the field is null.
The operator aliasses are changed to mimic the Haskell Data.Aeson libraries implementation.
(If, for legacy reasons, the alias for the old getFieldOptional shouldn't change, then switch (.??) for (.?!) and vice-versa.)
Added getFieldOptional' to Decode.Combinators
@thomashoneyman thomashoneyman self-assigned this Nov 11, 2018
@thomashoneyman thomashoneyman added type: enhancement A new feature or addition. help wanted labels Nov 11, 2018
@thomashoneyman
Copy link
Contributor

Hey @Vlix! Thanks for opening this PR. I'm sorry it's taken so long to hear a response.

This is directly related to #32 and before merging I'd like to hear some opinions in that thread. @alebon -- I see you've endorsed this PR, so you might like to weigh in on that issue and the right approach as well.

Either way, I hope to either merge this or something like it in the next week or so. Thanks for getting the ball rolling!

@thomashoneyman
Copy link
Contributor

Closed by #47

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A new feature or addition.
Development

Successfully merging this pull request may close these issues.

2 participants