Skip to content

Add a combinator for decoding maybe fields #17

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

Merged
merged 1 commit into from
Aug 5, 2016

Conversation

passy
Copy link
Contributor

@passy passy commented Aug 3, 2016

I'm not sure if this is something you want to include here, but I found it quite useful in my code.

This adds a (.??) combinator to decode optional fields, like (.:?) in Aeson. I'm not really sure how to add that to the existing test suite. Any help there would be much appreciated.


This change is Reviewable

@garyb
Copy link
Member

garyb commented Aug 3, 2016

Perhaps we could talk about it as an optional field rather than specifically a "maybe" field? As the intent is to handle fields that may not exist, not those that are maybe-typed, right?

@passy
Copy link
Contributor Author

passy commented Aug 3, 2016

True. Do you think renaming the function from getFieldMaybe to getFieldOptional would address that?

@garyb
Copy link
Member

garyb commented Aug 3, 2016

That was exactly what I meant, sorry I wasn't clear 😄

Adds (.??) akin to Aeson's (.:?) that decodes an optional field to a
Maybe.
@passy passy force-pushed the maybe-combinator branch from 0ec53ea to 631d82e Compare August 4, 2016 13:15
@passy
Copy link
Contributor Author

passy commented Aug 4, 2016

@garyb No worries, just wanted to be sure. :) I've updated the name.

@garyb
Copy link
Member

garyb commented Aug 5, 2016

Thanks!

@garyb garyb merged commit 0260407 into purescript-contrib:master Aug 5, 2016
@passy
Copy link
Contributor Author

passy commented Aug 5, 2016

Thanks for reviewing and merging! :)

On Fri, Aug 5, 2016, 12:39 Gary Burgess [email protected] wrote:

Merged #17
#17
.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#17 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAAmsoWB9AVqqqBNHHGHW2BNMIAE8dyZks5qcyDmgaJpZM4JbkWF
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants