Skip to content
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

use String instead of Int in API functions #25

Closed
wants to merge 3 commits into from

Conversation

swizzard
Copy link
Contributor

fixes #24

@as-capabl
Copy link

@swizzard
In my understanding, account-ids and status-ids are expressed by HastodonId defined at Type.hs.
Would you use HastodonId instead of String?

@as-capabl
Copy link

And I noticed several points that needed to change type into HastodonId in addition;

  • Types.hs: statusInReplyToId, statusInReplyToAccountId
    statusInReplyToId :: Maybe Int,
    statusInReplyToAccountId :: Maybe Int,
  • Option.hs: inReplyToId, mediaIds
    inReplyToId :: IsPostStatusOption a => Int -> a
    inReplyToId i = mkOption "in_reply_to_id" (Just $ show i)
    mediaIds :: IsPostStatusOption a => [Int] -> a
    mediaIds l = mkArrayOption "media_ids" $ show <$> l

@swizzard
Copy link
Contributor Author

@as-capabl done. i'm a little uncomfortable having account ids and status ids and media ids all be HastodonIds, since they represent pretty different things, but that can be put off for another commit. Similarly, it may be worth newtyping ids to prevent them from getting mixed up with other strings like status content

@as-capabl
Copy link

@swizzard Thanks a lot! 👍 I agree that various ids should be expressed by distinct types.

@swizzard
Copy link
Contributor Author

closed in favor of #27

@swizzard swizzard closed this May 22, 2018
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.

Weirdness in types
2 participants