{"action":"created","comment":{"url":"https://api.github.com/repos/quasar-analytics/quasar/pulls/comments/47380260","id":47380260,"diff_hunk":"@@ -0,0 +1,32 @@\n+package quasar.fp\n+\n+import quasar.Predef._\n+\n+import shapeless.tag.@@\n+import eu.timepit.refined.numeric.{NonNegative, Positive => RPositive, Negative}\n+import eu.timepit.refined.refineT\n+import scalaz.{Equal, Show}\n+\n+package object numeric {\n+\n+  type Natural = Long @@ NonNegative\n+  type Positive = Long @@ RPositive\n+\n+  def Positive(a: Long): Option[Positive] = refineT[RPositive](a).right.toOption\n+  def Natural(a: Long): Option[Natural] = refineT[NonNegative](a).right.toOption\n+\n+  def add[T:scala.Numeric](a:T @@ NonNegative, b: T @@ NonNegative): T @@ NonNegative =\n+    refineT[NonNegative].force(implicitly[scala.Numeric[T]].plus(a,b))\n+\n+  implicit def equalNonNegative[T]: Equal[T @@ NonNegative] = Equal.equalA[T @@ NonNegative]","path":"core/src/main/scala/quasar/fp/numeric/package.scala","position":21,"original_position":21,"commit_id":"647c86c368496814ab672b12c8b6ae08be38b2c9","original_commit_id":"647c86c368496814ab672b12c8b6ae08be38b2c9","user":{"login":"jedesah","id":1780116,"avatar_url":"https://avatars.githubusercontent.com/u/1780116?v=3","gravatar_id":"","url":"https://api.github.com/users/jedesah","html_url":"https://github.com/jedesah","followers_url":"https://api.github.com/users/jedesah/followers","following_url":"https://api.github.com/users/jedesah/following{/other_user}","gists_url":"https://api.github.com/users/jedesah/gists{/gist_id}","starred_url":"https://api.github.com/users/jedesah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jedesah/subscriptions","organizations_url":"https://api.github.com/users/jedesah/orgs","repos_url":"https://api.github.com/users/jedesah/repos","events_url":"https://api.github.com/users/jedesah/events{/privacy}","received_events_url":"https://api.github.com/users/jedesah/received_events","type":"User","site_admin":false},"body":"Ya probably, although I can't seem to wrap my mind around exactly why that would trigger a diverging implicit. And that relationship is rather useful in other contexts.","created_at":"2015-12-11T17:22:23Z","updated_at":"2015-12-11T17:22:23Z","html_url":"https://github.com/quasar-analytics/quasar/pull/1025#discussion_r47380260","pull_request_url":"https://api.github.com/repos/quasar-analytics/quasar/pulls/1025","_links":{"self":{"href":"https://api.github.com/repos/quasar-analytics/quasar/pulls/comments/47380260"},"html":{"href":"https://github.com/quasar-analytics/quasar/pull/1025#discussion_r47380260"},"pull_request":{"href":"https://api.github.com/repos/quasar-analytics/quasar/pulls/1025"}}},"pull_request":{"url":"https://api.github.com/repos/quasar-analytics/quasar/pulls/1025","id":53171174,"html_url":"https://github.com/quasar-analytics/quasar/pull/1025","diff_url":"https://github.com/quasar-analytics/quasar/pull/1025.diff","patch_url":"https://github.com/quasar-analytics/quasar/pull/1025.patch","issue_url":"https://api.github.com/repos/quasar-analytics/quasar/issues/1025","number":1025,"state":"open","locked":false,"title":"[SD-1145] Use refined NonNegative instead of hand rolled Natural","user":{"login":"jedesah","id":1780116,"avatar_url":"https://avatars.githubusercontent.com/u/1780116?v=3","gravatar_id":"","url":"https://api.github.com/users/jedesah","html_url":"https://github.com/jedesah","followers_url":"https://api.github.com/users/jedesah/followers","following_url":"https://api.github.com/users/jedesah/following{/other_user}","gists_url":"https://api.github.com/users/jedesah/gists{/gist_id}","starred_url":"https://api.github.com/users/jedesah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jedesah/subscriptions","organizations_url":"https://api.github.com/users/jedesah/orgs","repos_url":"https://api.github.com/users/jedesah/repos","events_url":"https://api.github.com/users/jedesah/events{/privacy}","received_events_url":"https://api.github.com/users/jedesah/received_events","type":"User","site_admin":false},"body":"If this is viewed as an improvement. I can do the same thing for Positive and we can use some of the other features of refined like typesafe regexes and such.","created_at":"2015-12-09T20:11:23Z","updated_at":"2015-12-11T17:22:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d32f52b63328ecf715b40379aabd029814db1f25","assignee":{"login":"wemrysi","id":32185,"avatar_url":"https://avatars.githubusercontent.com/u/32185?v=3","gravatar_id":"","url":"https://api.github.com/users/wemrysi","html_url":"https://github.com/wemrysi","followers_url":"https://api.github.com/users/wemrysi/followers","following_url":"https://api.github.com/users/wemrysi/following{/other_user}","gists_url":"https://api.github.com/users/wemrysi/gists{/gist_id}","starred_url":"https://api.github.com/users/wemrysi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wemrysi/subscriptions","organizations_url":"https://api.github.com/users/wemrysi/orgs","repos_url":"https://api.github.com/users/wemrysi/repos","events_url":"https://api.github.com/users/wemrysi/events{/privacy}","received_events_url":"https://api.github.com/users/wemrysi/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/quasar-analytics/quasar/pulls/1025/commits","review_comments_url":"https://api.github.com/repos/quasar-analytics/quasar/pulls/1025/comments","review_comment_url":"https://api.github.com/repos/quasar-analytics/quasar/pulls/comments{/number}","comments_url":"https://api.github.com/repos/quasar-analytics/quasar/issues/1025/comments","statuses_url":"https://api.github.com/repos/quasar-analytics/quasar/statuses/647c86c368496814ab672b12c8b6ae08be38b2c9","head":{"label":"jedesah:free_topic/add_refined","ref":"free_topic/add_refined","sha":"647c86c368496814ab672b12c8b6ae08be38b2c9","user":{"login":"jedesah","id":1780116,"avatar_url":"https://avatars.githubusercontent.com/u/1780116?v=3","gravatar_id":"","url":"https://api.github.com/users/jedesah","html_url":"https://github.com/jedesah","followers_url":"https://api.github.com/users/jedesah/followers","following_url":"https://api.github.com/users/jedesah/following{/other_user}","gists_url":"https://api.github.com/users/jedesah/gists{/gist_id}","starred_url":"https://api.github.com/users/jedesah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jedesah/subscriptions","organizations_url":"https://api.github.com/users/jedesah/orgs","repos_url":"https://api.github.com/users/jedesah/repos","events_url":"https://api.github.com/users/jedesah/events{/privacy}","received_events_url":"https://api.github.com/users/jedesah/received_events","type":"User","site_admin":false},"repo":{"id":39122146,"name":"Quasar","full_name":"jedesah/Quasar","owner":{"login":"jedesah","id":1780116,"avatar_url":"https://avatars.githubusercontent.com/u/1780116?v=3","gravatar_id":"","url":"https://api.github.com/users/jedesah","html_url":"https://github.com/jedesah","followers_url":"https://api.github.com/users/jedesah/followers","following_url":"https://api.github.com/users/jedesah/following{/other_user}","gists_url":"https://api.github.com/users/jedesah/gists{/gist_id}","starred_url":"https://api.github.com/users/jedesah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jedesah/subscriptions","organizations_url":"https://api.github.com/users/jedesah/orgs","repos_url":"https://api.github.com/users/jedesah/repos","events_url":"https://api.github.com/users/jedesah/events{/privacy}","received_events_url":"https://api.github.com/users/jedesah/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jedesah/Quasar","description":"The engine for SlamData","fork":true,"url":"https://api.github.com/repos/jedesah/Quasar","forks_url":"https://api.github.com/repos/jedesah/Quasar/forks","keys_url":"https://api.github.com/repos/jedesah/Quasar/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jedesah/Quasar/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jedesah/Quasar/teams","hooks_url":"https://api.github.com/repos/jedesah/Quasar/hooks","issue_events_url":"https://api.github.com/repos/jedesah/Quasar/issues/events{/number}","events_url":"https://api.github.com/repos/jedesah/Quasar/events","assignees_url":"https://api.github.com/repos/jedesah/Quasar/assignees{/user}","branches_url":"https://api.github.com/repos/jedesah/Quasar/branches{/branch}","tags_url":"https://api.github.com/repos/jedesah/Quasar/tags","blobs_url":"https://api.github.com/repos/jedesah/Quasar/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jedesah/Quasar/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jedesah/Quasar/git/refs{/sha}","trees_url":"https://api.github.com/repos/jedesah/Quasar/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jedesah/Quasar/statuses/{sha}","languages_url":"https://api.github.com/repos/jedesah/Quasar/languages","stargazers_url":"https://api.github.com/repos/jedesah/Quasar/stargazers","contributors_url":"https://api.github.com/repos/jedesah/Quasar/contributors","subscribers_url":"https://api.github.com/repos/jedesah/Quasar/subscribers","subscription_url":"https://api.github.com/repos/jedesah/Quasar/subscription","commits_url":"https://api.github.com/repos/jedesah/Quasar/commits{/sha}","git_commits_url":"https://api.github.com/repos/jedesah/Quasar/git/commits{/sha}","comments_url":"https://api.github.com/repos/jedesah/Quasar/comments{/number}","issue_comment_url":"https://api.github.com/repos/jedesah/Quasar/issues/comments{/number}","contents_url":"https://api.github.com/repos/jedesah/Quasar/contents/{+path}","compare_url":"https://api.github.com/repos/jedesah/Quasar/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jedesah/Quasar/merges","archive_url":"https://api.github.com/repos/jedesah/Quasar/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jedesah/Quasar/downloads","issues_url":"https://api.github.com/repos/jedesah/Quasar/issues{/number}","pulls_url":"https://api.github.com/repos/jedesah/Quasar/pulls{/number}","milestones_url":"https://api.github.com/repos/jedesah/Quasar/milestones{/number}","notifications_url":"https://api.github.com/repos/jedesah/Quasar/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jedesah/Quasar/labels{/name}","releases_url":"https://api.github.com/repos/jedesah/Quasar/releases{/id}","created_at":"2015-07-15T07:12:13Z","updated_at":"2015-09-14T20:57:00Z","pushed_at":"2015-12-10T20:53:45Z","git_url":"git://github.com/jedesah/Quasar.git","ssh_url":"git@github.com:jedesah/Quasar.git","clone_url":"https://github.com/jedesah/Quasar.git","svn_url":"https://github.com/jedesah/Quasar","homepage":null,"size":8189,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"quasar-analytics:feature/translate_web_api_for_free","ref":"feature/translate_web_api_for_free","sha":"ee5adbc0863177ee9efee7f69825d9389ce18d7c","user":{"login":"quasar-analytics","id":15095906,"avatar_url":"https://avatars.githubusercontent.com/u/15095906?v=3","gravatar_id":"","url":"https://api.github.com/users/quasar-analytics","html_url":"https://github.com/quasar-analytics","followers_url":"https://api.github.com/users/quasar-analytics/followers","following_url":"https://api.github.com/users/quasar-analytics/following{/other_user}","gists_url":"https://api.github.com/users/quasar-analytics/gists{/gist_id}","starred_url":"https://api.github.com/users/quasar-analytics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quasar-analytics/subscriptions","organizations_url":"https://api.github.com/users/quasar-analytics/orgs","repos_url":"https://api.github.com/users/quasar-analytics/repos","events_url":"https://api.github.com/users/quasar-analytics/events{/privacy}","received_events_url":"https://api.github.com/users/quasar-analytics/received_events","type":"Organization","site_admin":false},"repo":{"id":16515058,"name":"quasar","full_name":"quasar-analytics/quasar","owner":{"login":"quasar-analytics","id":15095906,"avatar_url":"https://avatars.githubusercontent.com/u/15095906?v=3","gravatar_id":"","url":"https://api.github.com/users/quasar-analytics","html_url":"https://github.com/quasar-analytics","followers_url":"https://api.github.com/users/quasar-analytics/followers","following_url":"https://api.github.com/users/quasar-analytics/following{/other_user}","gists_url":"https://api.github.com/users/quasar-analytics/gists{/gist_id}","starred_url":"https://api.github.com/users/quasar-analytics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quasar-analytics/subscriptions","organizations_url":"https://api.github.com/users/quasar-analytics/orgs","repos_url":"https://api.github.com/users/quasar-analytics/repos","events_url":"https://api.github.com/users/quasar-analytics/events{/privacy}","received_events_url":"https://api.github.com/users/quasar-analytics/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/quasar-analytics/quasar","description":"A NoSQL analytics engine that embraces post-relational analytics and pushes computation to the data.","fork":false,"url":"https://api.github.com/repos/quasar-analytics/quasar","forks_url":"https://api.github.com/repos/quasar-analytics/quasar/forks","keys_url":"https://api.github.com/repos/quasar-analytics/quasar/keys{/key_id}","collaborators_url":"https://api.github.com/repos/quasar-analytics/quasar/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/quasar-analytics/quasar/teams","hooks_url":"https://api.github.com/repos/quasar-analytics/quasar/hooks","issue_events_url":"https://api.github.com/repos/quasar-analytics/quasar/issues/events{/number}","events_url":"https://api.github.com/repos/quasar-analytics/quasar/events","assignees_url":"https://api.github.com/repos/quasar-analytics/quasar/assignees{/user}","branches_url":"https://api.github.com/repos/quasar-analytics/quasar/branches{/branch}","tags_url":"https://api.github.com/repos/quasar-analytics/quasar/tags","blobs_url":"https://api.github.com/repos/quasar-analytics/quasar/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/quasar-analytics/quasar/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/quasar-analytics/quasar/git/refs{/sha}","trees_url":"https://api.github.com/repos/quasar-analytics/quasar/git/trees{/sha}","statuses_url":"https://api.github.com/repos/quasar-analytics/quasar/statuses/{sha}","languages_url":"https://api.github.com/repos/quasar-analytics/quasar/languages","stargazers_url":"https://api.github.com/repos/quasar-analytics/quasar/stargazers","contributors_url":"https://api.github.com/repos/quasar-analytics/quasar/contributors","subscribers_url":"https://api.github.com/repos/quasar-analytics/quasar/subscribers","subscription_url":"https://api.github.com/repos/quasar-analytics/quasar/subscription","commits_url":"https://api.github.com/repos/quasar-analytics/quasar/commits{/sha}","git_commits_url":"https://api.github.com/repos/quasar-analytics/quasar/git/commits{/sha}","comments_url":"https://api.github.com/repos/quasar-analytics/quasar/comments{/number}","issue_comment_url":"https://api.github.com/repos/quasar-analytics/quasar/issues/comments{/number}","contents_url":"https://api.github.com/repos/quasar-analytics/quasar/contents/{+path}","compare_url":"https://api.github.com/repos/quasar-analytics/quasar/compare/{base}...{head}","merges_url":"https://api.github.com/repos/quasar-analytics/quasar/merges","archive_url":"https://api.github.com/repos/quasar-analytics/quasar/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/quasar-analytics/quasar/downloads","issues_url":"https://api.github.com/repos/quasar-analytics/quasar/issues{/number}","pulls_url":"https://api.github.com/repos/quasar-analytics/quasar/pulls{/number}","milestones_url":"https://api.github.com/repos/quasar-analytics/quasar/milestones{/number}","notifications_url":"https://api.github.com/repos/quasar-analytics/quasar/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/quasar-analytics/quasar/labels{/name}","releases_url":"https://api.github.com/repos/quasar-analytics/quasar/releases{/id}","created_at":"2014-02-04T15:01:27Z","updated_at":"2015-12-11T16:42:47Z","pushed_at":"2015-12-11T16:01:30Z","git_url":"git://github.com/quasar-analytics/quasar.git","ssh_url":"git@github.com:quasar-analytics/quasar.git","clone_url":"https://github.com/quasar-analytics/quasar.git","svn_url":"https://github.com/quasar-analytics/quasar","homepage":"","size":8608,"stargazers_count":175,"watchers_count":175,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":37,"mirror_url":null,"open_issues_count":4,"forks":37,"open_issues":4,"watchers":175,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/quasar-analytics/quasar/pulls/1025"},"html":{"href":"https://github.com/quasar-analytics/quasar/pull/1025"},"issue":{"href":"https://api.github.com/repos/quasar-analytics/quasar/issues/1025"},"comments":{"href":"https://api.github.com/repos/quasar-analytics/quasar/issues/1025/comments"},"review_comments":{"href":"https://api.github.com/repos/quasar-analytics/quasar/pulls/1025/comments"},"review_comment":{"href":"https://api.github.com/repos/quasar-analytics/quasar/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/quasar-analytics/quasar/pulls/1025/commits"},"statuses":{"href":"https://api.github.com/repos/quasar-analytics/quasar/statuses/647c86c368496814ab672b12c8b6ae08be38b2c9"}}}}