{"action":"created","comment":{"url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/pulls/comments/26448905","id":26448905,"diff_hunk":"@@ -0,0 +1,121 @@\n+module Data.Time where\n+\n+-- | A quantity of hours (not necessarily a value between 0 and 23).\n+newtype Hours = Hours Number\n+\n+instance eqHours :: Eq Hours where\n+  (==) (Hours x) (Hours y) = x == y\n+  (/=) (Hours x) (Hours y) = x /= y\n+\n+instance ordHours :: Ord Hours where\n+  compare (Hours x) (Hours y) = compare x y\n+\n+instance semiringHours :: Semiring Hours where\n+  (+) (Hours x) (Hours y) = Hours (x + y)\n+  (*) (Hours x) (Hours y) = Hours (x * y)\n+  zero = Hours 0\n+  one = Hours 1\n+\n+instance ringHours :: Ring Hours where\n+  (-) (Hours x) (Hours y) = Hours (x - y)\n+\n+instance moduloSemiringHours :: ModuloSemiring Hours where\n+  (/) (Hours x) (Hours y) = Hours (x / y)\n+  mod _ _ = Hours 0\n+\n+instance divisionRingHours :: DivisionRing Hours\n+\n+instance numHours :: Num Hours\n+\n+instance showHours :: Show Hours where\n+  show (Hours n) = \"(Hours \" ++ show n ++ \")\"\n+\n+-- | A quantity of minutes (not necessarily a value between 0 and 60).\n+newtype Minutes = Minutes Number","path":"src/Data/Time.purs","position":34,"original_position":34,"commit_id":"64d032fd89a9610bbd80836e4a7e47e4b4893e28","original_commit_id":"64d032fd89a9610bbd80836e4a7e47e4b4893e28","user":{"login":"jdegoes","id":156745,"avatar_url":"https://avatars.githubusercontent.com/u/156745?v=3","gravatar_id":"","url":"https://api.github.com/users/jdegoes","html_url":"https://github.com/jdegoes","followers_url":"https://api.github.com/users/jdegoes/followers","following_url":"https://api.github.com/users/jdegoes/following{/other_user}","gists_url":"https://api.github.com/users/jdegoes/gists{/gist_id}","starred_url":"https://api.github.com/users/jdegoes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdegoes/subscriptions","organizations_url":"https://api.github.com/users/jdegoes/orgs","repos_url":"https://api.github.com/users/jdegoes/repos","events_url":"https://api.github.com/users/jdegoes/events{/privacy}","received_events_url":"https://api.github.com/users/jdegoes/received_events","type":"User","site_admin":false},"body":"Ditto for this. It's harder to think about the code if I can expect `Minutes` to come back with fractional values, since then I have to carve those off and add them to seconds, etc.","created_at":"2015-03-15T15:56:27Z","updated_at":"2015-03-15T15:56:27Z","html_url":"https://github.com/purescript-contrib/purescript-datetime/pull/10#discussion_r26448905","pull_request_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/pulls/10","_links":{"self":{"href":"https://api.github.com/repos/purescript-contrib/purescript-datetime/pulls/comments/26448905"},"html":{"href":"https://github.com/purescript-contrib/purescript-datetime/pull/10#discussion_r26448905"},"pull_request":{"href":"https://api.github.com/repos/purescript-contrib/purescript-datetime/pulls/10"}}},"pull_request":{"url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/pulls/10","id":31194846,"html_url":"https://github.com/purescript-contrib/purescript-datetime/pull/10","diff_url":"https://github.com/purescript-contrib/purescript-datetime/pull/10.diff","patch_url":"https://github.com/purescript-contrib/purescript-datetime/pull/10.patch","issue_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/issues/10","number":10,"state":"open","locked":false,"title":"Library reform","user":{"login":"garyb","id":693642,"avatar_url":"https://avatars.githubusercontent.com/u/693642?v=3","gravatar_id":"","url":"https://api.github.com/users/garyb","html_url":"https://github.com/garyb","followers_url":"https://api.github.com/users/garyb/followers","following_url":"https://api.github.com/users/garyb/following{/other_user}","gists_url":"https://api.github.com/users/garyb/gists{/gist_id}","starred_url":"https://api.github.com/users/garyb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garyb/subscriptions","organizations_url":"https://api.github.com/users/garyb/orgs","repos_url":"https://api.github.com/users/garyb/repos","events_url":"https://api.github.com/users/garyb/events{/privacy}","received_events_url":"https://api.github.com/users/garyb/received_events","type":"User","site_admin":false},"body":"Thought it was about time this library was looked at again, it was originally thrown together in the early days of PS as a thin layer over the JS `Date` type.\r\n\r\nI've not changed things drastically, mostly just a reorganisation and trying to improve type safety - moving out the locale and UTC specific methods into their own modules and using `newtype`s for the date and time components.\r\n\r\nAny input welcome @paf31, @jdegoes, @joneshf, or anyone else out there. Anything I should reconsider, or missing things that should be added?\r\n\r\nI'll add documentation before merging this also.\r\n\r\nAlso resolves #7 and #9.","created_at":"2015-03-15T03:47:37Z","updated_at":"2015-03-15T15:56:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a75f3d2dc7f37e971b9dc33fddf7a0cab3b12825","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/pulls/10/commits","review_comments_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/pulls/10/comments","review_comment_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/pulls/comments{/number}","comments_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/issues/10/comments","statuses_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/statuses/64d032fd89a9610bbd80836e4a7e47e4b4893e28","head":{"label":"purescript-contrib:reform","ref":"reform","sha":"64d032fd89a9610bbd80836e4a7e47e4b4893e28","user":{"login":"purescript-contrib","id":7391813,"avatar_url":"https://avatars.githubusercontent.com/u/7391813?v=3","gravatar_id":"","url":"https://api.github.com/users/purescript-contrib","html_url":"https://github.com/purescript-contrib","followers_url":"https://api.github.com/users/purescript-contrib/followers","following_url":"https://api.github.com/users/purescript-contrib/following{/other_user}","gists_url":"https://api.github.com/users/purescript-contrib/gists{/gist_id}","starred_url":"https://api.github.com/users/purescript-contrib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/purescript-contrib/subscriptions","organizations_url":"https://api.github.com/users/purescript-contrib/orgs","repos_url":"https://api.github.com/users/purescript-contrib/repos","events_url":"https://api.github.com/users/purescript-contrib/events{/privacy}","received_events_url":"https://api.github.com/users/purescript-contrib/received_events","type":"Organization","site_admin":false},"repo":{"id":17002083,"name":"purescript-datetime","full_name":"purescript-contrib/purescript-datetime","owner":{"login":"purescript-contrib","id":7391813,"avatar_url":"https://avatars.githubusercontent.com/u/7391813?v=3","gravatar_id":"","url":"https://api.github.com/users/purescript-contrib","html_url":"https://github.com/purescript-contrib","followers_url":"https://api.github.com/users/purescript-contrib/followers","following_url":"https://api.github.com/users/purescript-contrib/following{/other_user}","gists_url":"https://api.github.com/users/purescript-contrib/gists{/gist_id}","starred_url":"https://api.github.com/users/purescript-contrib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/purescript-contrib/subscriptions","organizations_url":"https://api.github.com/users/purescript-contrib/orgs","repos_url":"https://api.github.com/users/purescript-contrib/repos","events_url":"https://api.github.com/users/purescript-contrib/events{/privacy}","received_events_url":"https://api.github.com/users/purescript-contrib/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/purescript-contrib/purescript-datetime","description":"Date and time library for PureScript.","fork":false,"url":"https://api.github.com/repos/purescript-contrib/purescript-datetime","forks_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/forks","keys_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/keys{/key_id}","collaborators_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/teams","hooks_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/hooks","issue_events_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/issues/events{/number}","events_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/events","assignees_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/assignees{/user}","branches_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/branches{/branch}","tags_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/tags","blobs_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/git/refs{/sha}","trees_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/git/trees{/sha}","statuses_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/statuses/{sha}","languages_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/languages","stargazers_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/stargazers","contributors_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/contributors","subscribers_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/subscribers","subscription_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/subscription","commits_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/commits{/sha}","git_commits_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/git/commits{/sha}","comments_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/comments{/number}","issue_comment_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/issues/comments{/number}","contents_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/contents/{+path}","compare_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/compare/{base}...{head}","merges_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/merges","archive_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/downloads","issues_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/issues{/number}","pulls_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/pulls{/number}","milestones_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/milestones{/number}","notifications_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/labels{/name}","releases_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/releases{/id}","created_at":"2014-02-19T22:58:07Z","updated_at":"2015-03-10T17:06:36Z","pushed_at":"2015-03-15T12:01:26Z","git_url":"git://github.com/purescript-contrib/purescript-datetime.git","ssh_url":"git@github.com:purescript-contrib/purescript-datetime.git","clone_url":"https://github.com/purescript-contrib/purescript-datetime.git","svn_url":"https://github.com/purescript-contrib/purescript-datetime","homepage":null,"size":330,"stargazers_count":7,"watchers_count":7,"language":"PureScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":3,"forks":5,"open_issues":3,"watchers":7,"default_branch":"master"}},"base":{"label":"purescript-contrib:master","ref":"master","sha":"d19d6f5db26da1a09263f990902bbad238b58b09","user":{"login":"purescript-contrib","id":7391813,"avatar_url":"https://avatars.githubusercontent.com/u/7391813?v=3","gravatar_id":"","url":"https://api.github.com/users/purescript-contrib","html_url":"https://github.com/purescript-contrib","followers_url":"https://api.github.com/users/purescript-contrib/followers","following_url":"https://api.github.com/users/purescript-contrib/following{/other_user}","gists_url":"https://api.github.com/users/purescript-contrib/gists{/gist_id}","starred_url":"https://api.github.com/users/purescript-contrib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/purescript-contrib/subscriptions","organizations_url":"https://api.github.com/users/purescript-contrib/orgs","repos_url":"https://api.github.com/users/purescript-contrib/repos","events_url":"https://api.github.com/users/purescript-contrib/events{/privacy}","received_events_url":"https://api.github.com/users/purescript-contrib/received_events","type":"Organization","site_admin":false},"repo":{"id":17002083,"name":"purescript-datetime","full_name":"purescript-contrib/purescript-datetime","owner":{"login":"purescript-contrib","id":7391813,"avatar_url":"https://avatars.githubusercontent.com/u/7391813?v=3","gravatar_id":"","url":"https://api.github.com/users/purescript-contrib","html_url":"https://github.com/purescript-contrib","followers_url":"https://api.github.com/users/purescript-contrib/followers","following_url":"https://api.github.com/users/purescript-contrib/following{/other_user}","gists_url":"https://api.github.com/users/purescript-contrib/gists{/gist_id}","starred_url":"https://api.github.com/users/purescript-contrib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/purescript-contrib/subscriptions","organizations_url":"https://api.github.com/users/purescript-contrib/orgs","repos_url":"https://api.github.com/users/purescript-contrib/repos","events_url":"https://api.github.com/users/purescript-contrib/events{/privacy}","received_events_url":"https://api.github.com/users/purescript-contrib/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/purescript-contrib/purescript-datetime","description":"Date and time library for PureScript.","fork":false,"url":"https://api.github.com/repos/purescript-contrib/purescript-datetime","forks_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/forks","keys_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/keys{/key_id}","collaborators_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/teams","hooks_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/hooks","issue_events_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/issues/events{/number}","events_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/events","assignees_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/assignees{/user}","branches_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/branches{/branch}","tags_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/tags","blobs_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/git/refs{/sha}","trees_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/git/trees{/sha}","statuses_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/statuses/{sha}","languages_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/languages","stargazers_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/stargazers","contributors_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/contributors","subscribers_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/subscribers","subscription_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/subscription","commits_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/commits{/sha}","git_commits_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/git/commits{/sha}","comments_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/comments{/number}","issue_comment_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/issues/comments{/number}","contents_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/contents/{+path}","compare_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/compare/{base}...{head}","merges_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/merges","archive_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/downloads","issues_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/issues{/number}","pulls_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/pulls{/number}","milestones_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/milestones{/number}","notifications_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/labels{/name}","releases_url":"https://api.github.com/repos/purescript-contrib/purescript-datetime/releases{/id}","created_at":"2014-02-19T22:58:07Z","updated_at":"2015-03-10T17:06:36Z","pushed_at":"2015-03-15T12:01:26Z","git_url":"git://github.com/purescript-contrib/purescript-datetime.git","ssh_url":"git@github.com:purescript-contrib/purescript-datetime.git","clone_url":"https://github.com/purescript-contrib/purescript-datetime.git","svn_url":"https://github.com/purescript-contrib/purescript-datetime","homepage":null,"size":330,"stargazers_count":7,"watchers_count":7,"language":"PureScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":3,"forks":5,"open_issues":3,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/purescript-contrib/purescript-datetime/pulls/10"},"html":{"href":"https://github.com/purescript-contrib/purescript-datetime/pull/10"},"issue":{"href":"https://api.github.com/repos/purescript-contrib/purescript-datetime/issues/10"},"comments":{"href":"https://api.github.com/repos/purescript-contrib/purescript-datetime/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/purescript-contrib/purescript-datetime/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/purescript-contrib/purescript-datetime/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/purescript-contrib/purescript-datetime/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/purescript-contrib/purescript-datetime/statuses/64d032fd89a9610bbd80836e4a7e47e4b4893e28"}}}}