-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
WIP: Add initial ToJSON #15
Conversation
There should be instances for those (at least I think they seem to work fine in the smoke tests?). Maybe fields should not be rendered at all (i.e. not present) when they are Nothing rather than rendering with blank or zero content. I will have to do some reading on |
I see, it could be somewhere, I'll just have to look it up. I just wanted to double check. |
, "comments" .= whIssueCommentCount hookIssue | ||
, "created_at" .= whIssueCreatedAt hookIssue | ||
, "updated_at" .= whIssueUpdatedAt hookIssue | ||
, "closed_at" .= (case whIssueClosedAt hookIssue of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it make sense to return an empty string if there is no value for closed_at
- i.e. it is Nothing
?
Instead, how about about letting it possibly be null
via fmap toJSON (whIssueClosedAt hookIssue)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. I'll do that
There's still a lot to do here, isn't there? Not a |
Sorry, I still haven't find time to work on it since the latest changes. Currently in the middle of finishing my semester with homework and final exams. I'll get back to it soon! |
9ecea05
to
05b1a85
Compare
I'm going to close this because it's reasonably old. Anyone attempting this can try and rebase it. |
Issue reference:
#12
This is my first attempt to add
ToJSON
instances. I am not sure how to do it better with line 689I am also curious, how does
FromJSON
parses the time format forcreated_at
,updated_at
, andclosed_at
. I looked through the file and the repl, it seems there's no instanceFromJSON UTCTime
anywhere.