Skip to content

Conversation

@colonelpanic8
Copy link
Contributor

Fixes #323

@colonelpanic8
Copy link
Contributor Author

Not sure what happend with fo r 7.8...

@colonelpanic8
Copy link
Contributor Author

@phadej Any chance you can take a look at this. I'd like to merge something to taffybar, that needs this change.

Copy link
Contributor

@phadej phadej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Small copy&paste mistake inline.

If you mind to run stylish-haskell on files you touched, that would be great too.

Thanks.

GHC-7.8.4 travis error is something weird. I'll figure that out.

"state_change" -> pure StateChangeReason
"subscribed" -> pure SubscribedReason
"team_mention" -> pure TeamMentionReason
_ -> fail $ "Unknown EventType " ++ show t
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NotificationReason


import GitHub.Data.Repos (Repo)
import GitHub.Data.Id (Id)
import GitHub.Data.Repos (RepoRef, Repo)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stylish-haskell formats imports for us.

data RW
= RO -- ^ /Read-only/, doesn't necessarily requires authentication
| RA -- ^ /Read autenticated/
| RA -- ^ /Read authenticated/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@colonelpanic8
Copy link
Contributor Author

Thanks @phadej. I've updated the pr. Are you planning to do a release any time soon?

instance FromJSON Notification where
parseJSON = withObject "Notification" $ \o -> Notification
<$> o .: "id"
<$> (mkId undefined . read <$> o .: "id")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happens here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, not sure what you are asking.

Are you asking about the undefined. I don't think ti should matter since its simply an uneeded (because the type can be inferred in this case) proxy.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So then Proxy works too, yes?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't original

<$> o .: id

work? Why?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@phadej For some reason, github uses a string type for the notification Id even though it uses a number type for all other ids. Not sure why they do that

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TomMD ahh, didn't know about Proxy. Seems like it is used pretty widely in this code base. I can make that change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@phadej Are you saying <$> o .: id would work even though the value is a string, not an int?

@colonelpanic8
Copy link
Contributor Author

@phadej ping? any chance thsi can be merged soon?

@colonelpanic8
Copy link
Contributor Author

@phadej ping. I think I fixed all of the issues you raised. Is there something else you wanted me to do?

@phadej
Copy link
Contributor

phadej commented May 30, 2019

Rebased into #372

@phadej phadej closed this May 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add notifications endpoints

3 participants