Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd Json.Decode.enum #902
Conversation
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
process-bot
Aug 24, 2017
Thanks for the pull request! Make sure it satisfies this checklist. My human colleagues will appreciate it!
Here is what to expect next, and if anyone wants to comment, keep these things in mind.
process-bot
commented
Aug 24, 2017
|
Thanks for the pull request! Make sure it satisfies this checklist. My human colleagues will appreciate it! Here is what to expect next, and if anyone wants to comment, keep these things in mind. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
evancz
May 22, 2018
Member
Can you share a few examples of this with me in one of the slack channels? I think it's a fine time to add it to elm-lang/json, but I want to do a bit more thorough review first.
|
Can you share a few examples of this with me in one of the slack channels? I think it's a fine time to add it to |
BrianHicks commentedAug 24, 2017
•
edited
Edited 1 time
-
BrianHicks
edited Aug 24, 2017 (most recent)
This PR implements
Json.Decode.enum, which isenum : Dict String a -> Decoder a.You use it like this:
Alternatives:
List (String, a)instead, which makes construction a little easierandThen. But, context in Slack, it's useful in a lot of places.Context: https://elmlang.slack.com/archives/C13L7S5GR/p1502488068299237
Ellie with this working: https://ellie-app.com/47dBBznjnHWa1/1