Skip to content

Commit 9fa0b01

Browse files
authored
Merge pull request #357 from jhrcek/fixExample
Fix doc examples
2 parents f12c477 + b4c5258 commit 9fa0b01

25 files changed

+69
-69
lines changed

github.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ description:
1515
>
1616
> main :: IO ()
1717
> main = do
18-
> possibleUser <- GH.executeRequest' $ GH.userInfoR "phadej"
18+
> possibleUser <- GH.executeRequest' $ GH.userInfoForR "phadej"
1919
> print possibleUser
2020
.
2121
For more of an overview please see the README: <https://github.com/phadej/github/blob/master/README.md>

src/GitHub.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-- this package.
88
--
99
-- See "GitHub.Request" module for executing 'Request', or other modules
10-
-- of this package (e.g. "GitHub.Users") for already composed versions.
10+
-- of this package (e.g. "GitHub.Endpoints.Users") for already composed versions.
1111
--
1212
-- The missing endpoints lists show which endpoints we know are missing, there
1313
-- might be more.

src/GitHub/Data.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
-- License : BSD-3-Clause
55
-- Maintainer : Oleg Grenrus <[email protected]>
66
--
7-
-- This module re-exports the @GitHub.Data.@ and "Github.Auth" submodules.
7+
-- This module re-exports the @GitHub.Data.@ and "GitHub.Auth" submodules.
88
module GitHub.Data (
99
-- * Tagged types
1010
-- ** Name

src/GitHub/Endpoints/Activity/Watching.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ watchersFor = watchersFor' Nothing
3030
-- | The list of users that are watching the specified Github repo.
3131
-- With authentication
3232
--
33-
-- > watchersFor' (Just (User (user, password))) "thoughtbot" "paperclip"
33+
-- > watchersFor' (Just $ BasicAuth "github-username" "github-password") "thoughtbot" "paperclip"
3434
watchersFor' :: Maybe Auth -> Name Owner -> Name Repo -> IO (Either Error (Vector SimpleUser))
3535
watchersFor' auth user repo =
3636
executeRequestMaybe auth $ watchersForR user repo FetchAll
@@ -50,7 +50,7 @@ reposWatchedBy = reposWatchedBy' Nothing
5050
-- | All the public repos watched by the specified user.
5151
-- With authentication
5252
--
53-
-- > reposWatchedBy' (Just (User (user, password))) "croaky"
53+
-- > reposWatchedBy' (Just $ BasicAuth "github-username" "github-password") "croaky"
5454
reposWatchedBy' :: Maybe Auth -> Name Owner -> IO (Either Error (Vector Repo))
5555
reposWatchedBy' auth user =
5656
executeRequestMaybe auth $ reposWatchedByR user FetchAll

src/GitHub/Endpoints/Gists.hs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import Prelude ()
2727

2828
-- | The list of all gists created by the user
2929
--
30-
-- > gists' (Just ("github-username", "github-password")) "mike-burns"
30+
-- > gists' (Just $ BasicAuth "github-username" "github-password") "mike-burns"
3131
gists' :: Maybe Auth -> Name Owner -> IO (Either Error (Vector Gist))
3232
gists' auth user =
3333
executeRequestMaybe auth $ gistsR user FetchAll
@@ -45,7 +45,7 @@ gistsR user = pagedQuery ["users", toPathPart user, "gists"] []
4545

4646
-- | A specific gist, given its id, with authentication credentials
4747
--
48-
-- > gist' (Just ("github-username", "github-password")) "225074"
48+
-- > gist' (Just $ BasicAuth "github-username" "github-password") "225074"
4949
gist' :: Maybe Auth -> Name Gist -> IO (Either Error Gist)
5050
gist' auth gid =
5151
executeRequestMaybe auth $ gistR gid
@@ -64,7 +64,7 @@ gistR gid =
6464

6565
-- | Star a gist by the authenticated user.
6666
--
67-
-- > starGist ("github-username", "github-password") "225074"
67+
-- > starGist (BasicAuth "github-username" "github-password") "225074"
6868
starGist :: Auth -> Name Gist -> IO (Either Error ())
6969
starGist auth gid = executeRequest auth $ starGistR gid
7070

@@ -75,7 +75,7 @@ starGistR gid = Command Put ["gists", toPathPart gid, "star"] mempty
7575

7676
-- | Unstar a gist by the authenticated user.
7777
--
78-
-- > unstarGist ("github-username", "github-password") "225074"
78+
-- > unstarGist (BasicAuth "github-username" "github-password") "225074"
7979
unstarGist :: Auth -> Name Gist -> IO (Either Error ())
8080
unstarGist auth gid = executeRequest auth $ unstarGistR gid
8181

@@ -86,7 +86,7 @@ unstarGistR gid = command Delete ["gists", toPathPart gid, "star"] mempty
8686

8787
-- | Delete a gist by the authenticated user.
8888
--
89-
-- > deleteGist ("github-username", "github-password") "225074"
89+
-- > deleteGist (BasicAuth "github-username" "github-password") "225074"
9090
deleteGist :: Auth -> Name Gist -> IO (Either Error ())
9191
deleteGist auth gid = executeRequest auth $ deleteGistR gid
9292

src/GitHub/Endpoints/GitData/Blobs.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import Prelude ()
1919

2020
-- | Query a blob by SHA1.
2121
--
22-
-- > blob' (Just ("github-username", "github-password")) "thoughtbot" "paperclip" "bc5c51d1ece1ee45f94b056a0f5a1674d7e8cba9"
22+
-- > blob' (Just $ BasicAuth "github-username" "github-password") "thoughtbot" "paperclip" "bc5c51d1ece1ee45f94b056a0f5a1674d7e8cba9"
2323
blob' :: Maybe Auth -> Name Owner -> Name Repo -> Name Blob -> IO (Either Error Blob)
2424
blob' auth user repo sha =
2525
executeRequestMaybe auth $ blobR user repo sha

src/GitHub/Endpoints/GitData/References.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import Prelude ()
2626

2727
-- | A single reference by the ref name.
2828
--
29-
-- > reference' (Just ("github-username", "github-password")) "mike-burns" "github" "heads/master"
29+
-- > reference' (Just $ BasicAuth "github-username" "github-password") "mike-burns" "github" "heads/master"
3030
reference' :: Maybe Auth -> Name Owner -> Name Repo -> Name GitReference -> IO (Either Error GitReference)
3131
reference' auth user repo ref =
3232
executeRequestMaybe auth $ referenceR user repo ref

src/GitHub/Endpoints/GitData/Trees.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import Prelude ()
2222

2323
-- | A tree for a SHA1.
2424
--
25-
-- > tree (Just ("github-username", "github-password")) "thoughtbot" "paperclip" "fe114451f7d066d367a1646ca7ac10e689b46844"
25+
-- > tree (Just $ BasicAuth "github-username" "github-password") "thoughtbot" "paperclip" "fe114451f7d066d367a1646ca7ac10e689b46844"
2626
tree' :: Maybe Auth -> Name Owner -> Name Repo -> Name Tree -> IO (Either Error Tree)
2727
tree' auth user repo sha =
2828
executeRequestMaybe auth $ treeR user repo sha
@@ -41,7 +41,7 @@ treeR user repo sha =
4141

4242
-- | A recursively-nested tree for a SHA1.
4343
--
44-
-- > nestedTree' (Just ("github-username", "github-password")) "thoughtbot" "paperclip" "fe114451f7d066d367a1646ca7ac10e689b46844"
44+
-- > nestedTree' (Just $ BasicAuth "github-username" "github-password") "thoughtbot" "paperclip" "fe114451f7d066d367a1646ca7ac10e689b46844"
4545
nestedTree' :: Maybe Auth -> Name Owner -> Name Repo -> Name Tree -> IO (Either Error Tree)
4646
nestedTree' auth user repo sha =
4747
executeRequestMaybe auth $ nestedTreeR user repo sha

src/GitHub/Endpoints/Issues.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ organizationIssuesR org opts =
4141
-- | Details on a specific issue, given the repo owner and name, and the issue
4242
-- number.'
4343
--
44-
-- > issue' (Just ("github-username", "github-password")) "thoughtbot" "paperclip" "462"
44+
-- > issue' (Just $ BasicAuth "github-username" "github-password") "thoughtbot" "paperclip" "462"
4545
issue' :: Maybe Auth -> Name Owner -> Name Repo -> Id Issue -> IO (Either Error Issue)
4646
issue' auth user reqRepoName reqIssueNumber =
4747
executeRequestMaybe auth $ issueR user reqRepoName reqIssueNumber
@@ -62,7 +62,7 @@ issueR user reqRepoName reqIssueNumber =
6262
-- | All issues for a repo (given the repo owner and name), with optional
6363
-- restrictions as described in the 'IssueRepoMod' data type.
6464
--
65-
-- > issuesForRepo' (Just ("github-username", "github-password")) "thoughtbot" "paperclip" [NoMilestone, OnlyClosed, Mentions "jyurek", Ascending]
65+
-- > issuesForRepo' (Just $ BasicAuth "github-username" "github-password") "thoughtbot" "paperclip" [NoMilestone, OnlyClosed, Mentions "jyurek", Ascending]
6666
issuesForRepo' :: Maybe Auth -> Name Owner -> Name Repo -> IssueRepoMod -> IO (Either Error (Vector Issue))
6767
issuesForRepo' auth user reqRepoName opts =
6868
executeRequestMaybe auth $ issuesForRepoR user reqRepoName opts FetchAll
@@ -90,7 +90,7 @@ newIssue title = NewIssue title Nothing mempty Nothing Nothing
9090

9191
-- | Create a new issue.
9292
--
93-
-- > createIssue (User (user, password)) user repo
93+
-- > createIssue (BasicAuth "github-username" "github-password") user repo
9494
-- > (newIssue "some_repo") {...}
9595
createIssue :: Auth -> Name Owner -> Name Repo -> NewIssue
9696
-> IO (Either Error Issue)
@@ -110,7 +110,7 @@ editOfIssue = EditIssue Nothing Nothing Nothing Nothing Nothing Nothing
110110

111111
-- | Edit an issue.
112112
--
113-
-- > editIssue (User (user, password)) user repo issue
113+
-- > editIssue (BasicAuth "github-username" "github-password") user repo issue
114114
-- > editOfIssue {...}
115115
editIssue :: Auth -> Name Owner -> Name Repo -> Id Issue -> EditIssue
116116
-> IO (Either Error Issue)

src/GitHub/Endpoints/Issues/Comments.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ comments = comments' Nothing
4646

4747
-- | All comments on an issue, by the issue's number, using authentication.
4848
--
49-
-- > comments' (User (user, password)) "thoughtbot" "paperclip" 635
49+
-- > comments' (Just $ BasicAuth "github-username" "github-password") "thoughtbot" "paperclip" 635
5050
comments' :: Maybe Auth -> Name Owner -> Name Repo -> IssueNumber -> IO (Either Error (Vector IssueComment))
5151
comments' auth user repo iid =
5252
executeRequestMaybe auth $ commentsR user repo iid FetchAll
@@ -59,7 +59,7 @@ commentsR user repo iid =
5959

6060
-- | Create a new comment.
6161
--
62-
-- > createComment (User (user, password)) user repo issue
62+
-- > createComment (BasicAuth "github-username" "github-password") user repo issue
6363
-- > "some words"
6464
createComment :: Auth -> Name Owner -> Name Repo -> IssueNumber -> Text
6565
-> IO (Either Error Comment)
@@ -76,7 +76,7 @@ createCommentR user repo iss body =
7676

7777
-- | Edit a comment.
7878
--
79-
-- > editComment (User (user, password)) user repo commentid
79+
-- > editComment (BasicAuth "github-username" "github-password") user repo commentid
8080
-- > "new words"
8181
editComment :: Auth -> Name Owner -> Name Repo -> Id Comment -> Text
8282
-> IO (Either Error Comment)
@@ -93,7 +93,7 @@ editCommentR user repo commid body =
9393

9494
-- | Delete a comment.
9595
--
96-
-- > deleteComment (User (user, password)) user repo commentid
96+
-- > deleteComment (BasicAuth "github-username" "github-password") user repo commentid
9797
deleteComment :: Auth -> Name Owner -> Name Repo -> Id Comment
9898
-> IO (Either Error ())
9999
deleteComment auth user repo commid =

0 commit comments

Comments
 (0)