{"action":"created","comment":{"url":"https://api.github.com/repos/twitter/algebird/pulls/comments/67067277","id":67067277,"diff_hunk":"@@ -105,6 +116,22 @@ object Batched {\n     }\n \n   /**\n+   * Equivalence for batches.\n+   *\n+   * Batches are equivalent if they sum to the same value. Since the\n+   * free semigroup is associative, it's not correct to take tree\n+   * structure into account when determining equality.\n+   *\n+   * One thing to note here is that two equivalent batches might\n+   * produce different lists (for instance, if one of the batches has\n+   * more zeros in it than another one).\n+   */\n+  def equiv[A](implicit s: Semigroup[A]): Equiv[Batched[A]] =","path":"algebird-core/src/main/scala/com/twitter/algebird/Batched.scala","position":129,"original_position":48,"commit_id":"979cec809ec29efcc3d66788d3755ac749cf768c","original_commit_id":"979cec809ec29efcc3d66788d3755ac749cf768c","user":{"login":"johnynek","id":67958,"avatar_url":"https://avatars.githubusercontent.com/u/67958?v=3","gravatar_id":"","url":"https://api.github.com/users/johnynek","html_url":"https://github.com/johnynek","followers_url":"https://api.github.com/users/johnynek/followers","following_url":"https://api.github.com/users/johnynek/following{/other_user}","gists_url":"https://api.github.com/users/johnynek/gists{/gist_id}","starred_url":"https://api.github.com/users/johnynek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnynek/subscriptions","organizations_url":"https://api.github.com/users/johnynek/orgs","repos_url":"https://api.github.com/users/johnynek/repos","events_url":"https://api.github.com/users/johnynek/events{/privacy}","received_events_url":"https://api.github.com/users/johnynek/received_events","type":"User","site_admin":false},"body":"can we make this implicit?","created_at":"2016-06-14T22:11:42Z","updated_at":"2016-06-14T22:11:42Z","html_url":"https://github.com/twitter/algebird/pull/530#discussion_r67067277","pull_request_url":"https://api.github.com/repos/twitter/algebird/pulls/530","_links":{"self":{"href":"https://api.github.com/repos/twitter/algebird/pulls/comments/67067277"},"html":{"href":"https://github.com/twitter/algebird/pull/530#discussion_r67067277"},"pull_request":{"href":"https://api.github.com/repos/twitter/algebird/pulls/530"}}},"pull_request":{"url":"https://api.github.com/repos/twitter/algebird/pulls/530","id":73816052,"html_url":"https://github.com/twitter/algebird/pull/530","diff_url":"https://github.com/twitter/algebird/pull/530.diff","patch_url":"https://github.com/twitter/algebird/pull/530.patch","issue_url":"https://api.github.com/repos/twitter/algebird/issues/530","number":530,"state":"open","locked":false,"title":"Add Batched[A] type for efficient lazy addition","user":{"login":"non","id":218045,"avatar_url":"https://avatars.githubusercontent.com/u/218045?v=3","gravatar_id":"","url":"https://api.github.com/users/non","html_url":"https://github.com/non","followers_url":"https://api.github.com/users/non/followers","following_url":"https://api.github.com/users/non/following{/other_user}","gists_url":"https://api.github.com/users/non/gists{/gist_id}","starred_url":"https://api.github.com/users/non/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/non/subscriptions","organizations_url":"https://api.github.com/users/non/orgs","repos_url":"https://api.github.com/users/non/repos","events_url":"https://api.github.com/users/non/events{/privacy}","received_events_url":"https://api.github.com/users/non/received_events","type":"User","site_admin":false},"body":"This is the free semigroup -- it represents combining one or more\r\nelements using an associative operation. The values are stored in a\r\ntree structure, which can be traversed. If a semigroup for the\r\nunderlying values becomes available, the structure can be summed to a\r\nsingle value.\r\n\r\nBatching represents a space/time trade-off (we use more space to use\r\nless time). In some cases these structures may become too big. To\r\naddress this, there are constructors for `Monoid[Batched[A]]` and\r\n`Semigroup[Batched[A]]` instances that will periodically compact\r\nthemselves (summing the tree to a single value) to keep the overall\r\nsize below a specific parameter.\r\n\r\nBatching is appropriate anytime an eager concatenation or combination\r\nwill produce expensive intermediate values that will be thrown away, and a more\r\nefficient aggregate summation is possible. In those cases, building up\r\na batch and then summing it should result in much more efficient\r\noperations.\r\n\r\nThis commit adds the type, with documentation. It also adds some basic\r\nlaw-checks and tests.","created_at":"2016-06-14T21:22:36Z","updated_at":"2016-06-14T22:11:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"66f077790ed24a18c9cb80b4c1b28feba7356158","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/twitter/algebird/pulls/530/commits","review_comments_url":"https://api.github.com/repos/twitter/algebird/pulls/530/comments","review_comment_url":"https://api.github.com/repos/twitter/algebird/pulls/comments{/number}","comments_url":"https://api.github.com/repos/twitter/algebird/issues/530/comments","statuses_url":"https://api.github.com/repos/twitter/algebird/statuses/979cec809ec29efcc3d66788d3755ac749cf768c","head":{"label":"non:topic/batching-and-efficiency","ref":"topic/batching-and-efficiency","sha":"979cec809ec29efcc3d66788d3755ac749cf768c","user":{"login":"non","id":218045,"avatar_url":"https://avatars.githubusercontent.com/u/218045?v=3","gravatar_id":"","url":"https://api.github.com/users/non","html_url":"https://github.com/non","followers_url":"https://api.github.com/users/non/followers","following_url":"https://api.github.com/users/non/following{/other_user}","gists_url":"https://api.github.com/users/non/gists{/gist_id}","starred_url":"https://api.github.com/users/non/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/non/subscriptions","organizations_url":"https://api.github.com/users/non/orgs","repos_url":"https://api.github.com/users/non/repos","events_url":"https://api.github.com/users/non/events{/privacy}","received_events_url":"https://api.github.com/users/non/received_events","type":"User","site_admin":false},"repo":{"id":54587268,"name":"algebird","full_name":"non/algebird","owner":{"login":"non","id":218045,"avatar_url":"https://avatars.githubusercontent.com/u/218045?v=3","gravatar_id":"","url":"https://api.github.com/users/non","html_url":"https://github.com/non","followers_url":"https://api.github.com/users/non/followers","following_url":"https://api.github.com/users/non/following{/other_user}","gists_url":"https://api.github.com/users/non/gists{/gist_id}","starred_url":"https://api.github.com/users/non/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/non/subscriptions","organizations_url":"https://api.github.com/users/non/orgs","repos_url":"https://api.github.com/users/non/repos","events_url":"https://api.github.com/users/non/events{/privacy}","received_events_url":"https://api.github.com/users/non/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/non/algebird","description":"Abstract Algebra for Scala","fork":true,"url":"https://api.github.com/repos/non/algebird","forks_url":"https://api.github.com/repos/non/algebird/forks","keys_url":"https://api.github.com/repos/non/algebird/keys{/key_id}","collaborators_url":"https://api.github.com/repos/non/algebird/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/non/algebird/teams","hooks_url":"https://api.github.com/repos/non/algebird/hooks","issue_events_url":"https://api.github.com/repos/non/algebird/issues/events{/number}","events_url":"https://api.github.com/repos/non/algebird/events","assignees_url":"https://api.github.com/repos/non/algebird/assignees{/user}","branches_url":"https://api.github.com/repos/non/algebird/branches{/branch}","tags_url":"https://api.github.com/repos/non/algebird/tags","blobs_url":"https://api.github.com/repos/non/algebird/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/non/algebird/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/non/algebird/git/refs{/sha}","trees_url":"https://api.github.com/repos/non/algebird/git/trees{/sha}","statuses_url":"https://api.github.com/repos/non/algebird/statuses/{sha}","languages_url":"https://api.github.com/repos/non/algebird/languages","stargazers_url":"https://api.github.com/repos/non/algebird/stargazers","contributors_url":"https://api.github.com/repos/non/algebird/contributors","subscribers_url":"https://api.github.com/repos/non/algebird/subscribers","subscription_url":"https://api.github.com/repos/non/algebird/subscription","commits_url":"https://api.github.com/repos/non/algebird/commits{/sha}","git_commits_url":"https://api.github.com/repos/non/algebird/git/commits{/sha}","comments_url":"https://api.github.com/repos/non/algebird/comments{/number}","issue_comment_url":"https://api.github.com/repos/non/algebird/issues/comments{/number}","contents_url":"https://api.github.com/repos/non/algebird/contents/{+path}","compare_url":"https://api.github.com/repos/non/algebird/compare/{base}...{head}","merges_url":"https://api.github.com/repos/non/algebird/merges","archive_url":"https://api.github.com/repos/non/algebird/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/non/algebird/downloads","issues_url":"https://api.github.com/repos/non/algebird/issues{/number}","pulls_url":"https://api.github.com/repos/non/algebird/pulls{/number}","milestones_url":"https://api.github.com/repos/non/algebird/milestones{/number}","notifications_url":"https://api.github.com/repos/non/algebird/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/non/algebird/labels{/name}","releases_url":"https://api.github.com/repos/non/algebird/releases{/id}","deployments_url":"https://api.github.com/repos/non/algebird/deployments","created_at":"2016-03-23T19:26:37Z","updated_at":"2016-03-23T19:26:38Z","pushed_at":"2016-06-14T22:08:46Z","git_url":"git://github.com/non/algebird.git","ssh_url":"git@github.com:non/algebird.git","clone_url":"https://github.com/non/algebird.git","svn_url":"https://github.com/non/algebird","homepage":"https://twitter.com/scalding","size":4837,"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":"develop"}},"base":{"label":"twitter:develop","ref":"develop","sha":"b8fa8e0226d8d54901b6ba86ac87fd6cb644b9cd","user":{"login":"twitter","id":50278,"avatar_url":"https://avatars.githubusercontent.com/u/50278?v=3","gravatar_id":"","url":"https://api.github.com/users/twitter","html_url":"https://github.com/twitter","followers_url":"https://api.github.com/users/twitter/followers","following_url":"https://api.github.com/users/twitter/following{/other_user}","gists_url":"https://api.github.com/users/twitter/gists{/gist_id}","starred_url":"https://api.github.com/users/twitter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twitter/subscriptions","organizations_url":"https://api.github.com/users/twitter/orgs","repos_url":"https://api.github.com/users/twitter/repos","events_url":"https://api.github.com/users/twitter/events{/privacy}","received_events_url":"https://api.github.com/users/twitter/received_events","type":"Organization","site_admin":false},"repo":{"id":5275507,"name":"algebird","full_name":"twitter/algebird","owner":{"login":"twitter","id":50278,"avatar_url":"https://avatars.githubusercontent.com/u/50278?v=3","gravatar_id":"","url":"https://api.github.com/users/twitter","html_url":"https://github.com/twitter","followers_url":"https://api.github.com/users/twitter/followers","following_url":"https://api.github.com/users/twitter/following{/other_user}","gists_url":"https://api.github.com/users/twitter/gists{/gist_id}","starred_url":"https://api.github.com/users/twitter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twitter/subscriptions","organizations_url":"https://api.github.com/users/twitter/orgs","repos_url":"https://api.github.com/users/twitter/repos","events_url":"https://api.github.com/users/twitter/events{/privacy}","received_events_url":"https://api.github.com/users/twitter/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/twitter/algebird","description":"Abstract Algebra for Scala","fork":false,"url":"https://api.github.com/repos/twitter/algebird","forks_url":"https://api.github.com/repos/twitter/algebird/forks","keys_url":"https://api.github.com/repos/twitter/algebird/keys{/key_id}","collaborators_url":"https://api.github.com/repos/twitter/algebird/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/twitter/algebird/teams","hooks_url":"https://api.github.com/repos/twitter/algebird/hooks","issue_events_url":"https://api.github.com/repos/twitter/algebird/issues/events{/number}","events_url":"https://api.github.com/repos/twitter/algebird/events","assignees_url":"https://api.github.com/repos/twitter/algebird/assignees{/user}","branches_url":"https://api.github.com/repos/twitter/algebird/branches{/branch}","tags_url":"https://api.github.com/repos/twitter/algebird/tags","blobs_url":"https://api.github.com/repos/twitter/algebird/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/twitter/algebird/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/twitter/algebird/git/refs{/sha}","trees_url":"https://api.github.com/repos/twitter/algebird/git/trees{/sha}","statuses_url":"https://api.github.com/repos/twitter/algebird/statuses/{sha}","languages_url":"https://api.github.com/repos/twitter/algebird/languages","stargazers_url":"https://api.github.com/repos/twitter/algebird/stargazers","contributors_url":"https://api.github.com/repos/twitter/algebird/contributors","subscribers_url":"https://api.github.com/repos/twitter/algebird/subscribers","subscription_url":"https://api.github.com/repos/twitter/algebird/subscription","commits_url":"https://api.github.com/repos/twitter/algebird/commits{/sha}","git_commits_url":"https://api.github.com/repos/twitter/algebird/git/commits{/sha}","comments_url":"https://api.github.com/repos/twitter/algebird/comments{/number}","issue_comment_url":"https://api.github.com/repos/twitter/algebird/issues/comments{/number}","contents_url":"https://api.github.com/repos/twitter/algebird/contents/{+path}","compare_url":"https://api.github.com/repos/twitter/algebird/compare/{base}...{head}","merges_url":"https://api.github.com/repos/twitter/algebird/merges","archive_url":"https://api.github.com/repos/twitter/algebird/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/twitter/algebird/downloads","issues_url":"https://api.github.com/repos/twitter/algebird/issues{/number}","pulls_url":"https://api.github.com/repos/twitter/algebird/pulls{/number}","milestones_url":"https://api.github.com/repos/twitter/algebird/milestones{/number}","notifications_url":"https://api.github.com/repos/twitter/algebird/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/twitter/algebird/labels{/name}","releases_url":"https://api.github.com/repos/twitter/algebird/releases{/id}","deployments_url":"https://api.github.com/repos/twitter/algebird/deployments","created_at":"2012-08-02T17:24:42Z","updated_at":"2016-06-14T02:41:23Z","pushed_at":"2016-06-14T22:08:47Z","git_url":"git://github.com/twitter/algebird.git","ssh_url":"git@github.com:twitter/algebird.git","clone_url":"https://github.com/twitter/algebird.git","svn_url":"https://github.com/twitter/algebird","homepage":"https://twitter.com/scalding","size":5786,"stargazers_count":1247,"watchers_count":1247,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":200,"mirror_url":null,"open_issues_count":106,"forks":200,"open_issues":106,"watchers":1247,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/twitter/algebird/pulls/530"},"html":{"href":"https://github.com/twitter/algebird/pull/530"},"issue":{"href":"https://api.github.com/repos/twitter/algebird/issues/530"},"comments":{"href":"https://api.github.com/repos/twitter/algebird/issues/530/comments"},"review_comments":{"href":"https://api.github.com/repos/twitter/algebird/pulls/530/comments"},"review_comment":{"href":"https://api.github.com/repos/twitter/algebird/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/twitter/algebird/pulls/530/commits"},"statuses":{"href":"https://api.github.com/repos/twitter/algebird/statuses/979cec809ec29efcc3d66788d3755ac749cf768c"}}}}
{"actor":{"display_login":"johnynek"}}