Skip to content

Commit f049967

Browse files
committed
Update the example usage to be more accurate.
1 parent 23356a8 commit f049967

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,20 @@ Example Usage
2121
import qualified Github.Repos.Commits as Github
2222

2323
main = do
24-
possibleCommits <- Github.commitsFor "thoughtbot" "paperclip"
24+
possibleCommits Github.commitsFor "thoughtbot" "paperclip"
2525
case possibleCommits of
26-
(Left error) -> putStrLn $ "Error: " ++ (show error)
27-
(Right commits) -> putStrLn $ show $ map formatCommit commits
28-
29-
formatCommit :: Commit -> String
26+
(Left error) putStrLn $ "Error: " ++ (show error)
27+
(Right commits) putStrLn $ intercalate "λnλn" $ map formatCommit commits
28+
29+
formatCommit :: Github.Commit String
3030
formatCommit commit =
3131
"commit " ++ (Github.commitSha commit) ++
32-
"\nAuthor: " ++ (formatAuthor author) ++
33-
"\nDate: " ++ (show $ Github.authorDate author) ++
34-
"\n\n\t" ++ (Github.commitMessage commit)
32+
"λnAuthor: " ++ (formatAuthor author) ++
33+
"λnDate: " ++ (show $ Github.fromGithubDate $ Github.authorDate author) ++
34+
"λnλnλt" ++ (Github.commitMessage commit)
3535
where author = Github.commitAuthor commit
36-
37-
formatAuthor :: Author -> String
36+
37+
formatAuthor :: Github.Author String
3838
formatAuthor author =
3939
(Github.authorName author) ++ " <" ++ (Github.authorEmail author) ++ ">"
4040

0 commit comments

Comments
 (0)