{"action":"created","comment":{"url":"https://api.github.com/repos/typelevel/cats/pulls/comments/174542265","pull_request_review_id":103918624,"id":174542265,"diff_hunk":"@@ -33,4 +33,58 @@ final class FoldableOps[F[_], A](val fa: F[A]) extends AnyVal {\n \n   def foldr[B](b: Eval[B])(f: (A, Eval[B]) => Eval[B])(implicit F: Foldable[F]): Eval[B] =\n     F.foldRight(fa, b)(f)\n+\n+   /**\n+   * test if `F[A]` contains an `A`, named contains_ to avoid conflict with existing contains which uses universal equality\n+   *\n+   * Example:\n+   * {{{\n+   * scala> import cats.implicits._\n+   *\n+   * scala> val l: List[Int] = List(1, 2, 3, 4)\n+   * scala> l.contains_(1)\n+   * res0: Boolean = true\n+   * scala> l.contains_(5)\n+   * res1: Boolean = false\n+   * }}}\n+   */\n+  def contains_(v: A)(implicit ev: Eq[A], F: Foldable[F]): Boolean =\n+    F.exists(fa)(ev.eqv(_, v))\n+\n+   /**\n+   * Intercalate with a prefix and a suffix\n+   *\n+   * Example:\n+   * {{{\n+   * scala> import cats.implicits._\n+   *\n+   * scala> val l: List[String] = List(\"1\", \"2\", \"3\")\n+   * scala> l.foldSmash(\"List(\", \",\", \")\")\n+   * res0: String = List(1,2,3)\n+   * }}}\n+   */\n+  def foldSmash(prefix: A, delim: A, suffix: A)(implicit A: Monoid[A], F: Foldable[F]): A =\n+    A.combine(prefix, A.combine(F.intercalate(fa, delim), suffix))\n+\n+   /**\n+   * Make a string using `Show`, named as `mkString_` to avoid conflict\n+   *\n+   * Example:\n+   * {{{\n+   * scala> import cats.implicits._\n+   *\n+   * scala> val l: List[Int] = List(1, 2, 3)\n+   * scala> l.mkString_(\"L[\", \";\", \"]\")\n+   * res0: String = L[1;2;3]\n+   * }}}\n+   */\n+  def mkString_(prefix: String, delim: String, suffix: String)(implicit A: Show[A], F: Foldable[F]): String = {\n+    val b = F.foldLeft(fa, new StringBuilder){ (builder, a) =>\n+      builder append A.show(a) append delim\n+    }\n+    if (b.isEmpty)\n+      \"\"","path":"core/src/main/scala/cats/syntax/foldable.scala","position":54,"original_position":54,"commit_id":"c74ac49a49345f2a25eaa782d46e917ac5c2af3f","original_commit_id":"c74ac49a49345f2a25eaa782d46e917ac5c2af3f","user":{"login":"johnynek","id":67958,"avatar_url":"https://avatars0.githubusercontent.com/u/67958?v=4","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":"don't we need the prefix and suffix here? Can we have a test that exercises this against scala's mkString in the same case?","created_at":"2018-03-14T17:22:39Z","updated_at":"2018-03-14T17:23:01Z","html_url":"https://github.com/typelevel/cats/pull/2123#discussion_r174542265","pull_request_url":"https://api.github.com/repos/typelevel/cats/pulls/2123","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/typelevel/cats/pulls/comments/174542265"},"html":{"href":"https://github.com/typelevel/cats/pull/2123#discussion_r174542265"},"pull_request":{"href":"https://api.github.com/repos/typelevel/cats/pulls/2123"}}},"pull_request":{"url":"https://api.github.com/repos/typelevel/cats/pulls/2123","id":159342430,"html_url":"https://github.com/typelevel/cats/pull/2123","diff_url":"https://github.com/typelevel/cats/pull/2123.diff","patch_url":"https://github.com/typelevel/cats/pull/2123.patch","issue_url":"https://api.github.com/repos/typelevel/cats/issues/2123","number":2123,"state":"open","locked":false,"title":"Add `contains_`, `foldSmash` and `mkString_` to `FoldableOps`","user":{"login":"rsoeldner","id":26225067,"avatar_url":"https://avatars2.githubusercontent.com/u/26225067?v=4","gravatar_id":"","url":"https://api.github.com/users/rsoeldner","html_url":"https://github.com/rsoeldner","followers_url":"https://api.github.com/users/rsoeldner/followers","following_url":"https://api.github.com/users/rsoeldner/following{/other_user}","gists_url":"https://api.github.com/users/rsoeldner/gists{/gist_id}","starred_url":"https://api.github.com/users/rsoeldner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rsoeldner/subscriptions","organizations_url":"https://api.github.com/users/rsoeldner/orgs","repos_url":"https://api.github.com/users/rsoeldner/repos","events_url":"https://api.github.com/users/rsoeldner/events{/privacy}","received_events_url":"https://api.github.com/users/rsoeldner/received_events","type":"User","site_admin":false},"body":"#2113, Am I right, test should be added to the `FoldableSuite` ?","created_at":"2017-12-20T06:47:33Z","updated_at":"2018-03-14T17:23:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"effc902bbda6d41e67c7f18c169f44725a8a6963","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":{"url":"https://api.github.com/repos/typelevel/cats/milestones/6","html_url":"https://github.com/typelevel/cats/milestone/6","labels_url":"https://api.github.com/repos/typelevel/cats/milestones/6/labels","id":2949390,"number":6,"title":"1.1","description":"next release after 1.0","creator":{"login":"kailuowang","id":83257,"avatar_url":"https://avatars3.githubusercontent.com/u/83257?v=4","gravatar_id":"","url":"https://api.github.com/users/kailuowang","html_url":"https://github.com/kailuowang","followers_url":"https://api.github.com/users/kailuowang/followers","following_url":"https://api.github.com/users/kailuowang/following{/other_user}","gists_url":"https://api.github.com/users/kailuowang/gists{/gist_id}","starred_url":"https://api.github.com/users/kailuowang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kailuowang/subscriptions","organizations_url":"https://api.github.com/users/kailuowang/orgs","repos_url":"https://api.github.com/users/kailuowang/repos","events_url":"https://api.github.com/users/kailuowang/events{/privacy}","received_events_url":"https://api.github.com/users/kailuowang/received_events","type":"User","site_admin":false},"open_issues":5,"closed_issues":36,"state":"open","created_at":"2017-11-30T16:21:43Z","updated_at":"2018-03-14T15:27:25Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/typelevel/cats/pulls/2123/commits","review_comments_url":"https://api.github.com/repos/typelevel/cats/pulls/2123/comments","review_comment_url":"https://api.github.com/repos/typelevel/cats/pulls/comments{/number}","comments_url":"https://api.github.com/repos/typelevel/cats/issues/2123/comments","statuses_url":"https://api.github.com/repos/typelevel/cats/statuses/c74ac49a49345f2a25eaa782d46e917ac5c2af3f","head":{"label":"rsoeldner:add-foldable-methods","ref":"add-foldable-methods","sha":"c74ac49a49345f2a25eaa782d46e917ac5c2af3f","user":{"login":"rsoeldner","id":26225067,"avatar_url":"https://avatars2.githubusercontent.com/u/26225067?v=4","gravatar_id":"","url":"https://api.github.com/users/rsoeldner","html_url":"https://github.com/rsoeldner","followers_url":"https://api.github.com/users/rsoeldner/followers","following_url":"https://api.github.com/users/rsoeldner/following{/other_user}","gists_url":"https://api.github.com/users/rsoeldner/gists{/gist_id}","starred_url":"https://api.github.com/users/rsoeldner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rsoeldner/subscriptions","organizations_url":"https://api.github.com/users/rsoeldner/orgs","repos_url":"https://api.github.com/users/rsoeldner/repos","events_url":"https://api.github.com/users/rsoeldner/events{/privacy}","received_events_url":"https://api.github.com/users/rsoeldner/received_events","type":"User","site_admin":false},"repo":{"id":111942875,"name":"cats","full_name":"rsoeldner/cats","owner":{"login":"rsoeldner","id":26225067,"avatar_url":"https://avatars2.githubusercontent.com/u/26225067?v=4","gravatar_id":"","url":"https://api.github.com/users/rsoeldner","html_url":"https://github.com/rsoeldner","followers_url":"https://api.github.com/users/rsoeldner/followers","following_url":"https://api.github.com/users/rsoeldner/following{/other_user}","gists_url":"https://api.github.com/users/rsoeldner/gists{/gist_id}","starred_url":"https://api.github.com/users/rsoeldner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rsoeldner/subscriptions","organizations_url":"https://api.github.com/users/rsoeldner/orgs","repos_url":"https://api.github.com/users/rsoeldner/repos","events_url":"https://api.github.com/users/rsoeldner/events{/privacy}","received_events_url":"https://api.github.com/users/rsoeldner/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rsoeldner/cats","description":"Lightweight, modular, and extensible library for functional programming.","fork":true,"url":"https://api.github.com/repos/rsoeldner/cats","forks_url":"https://api.github.com/repos/rsoeldner/cats/forks","keys_url":"https://api.github.com/repos/rsoeldner/cats/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rsoeldner/cats/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rsoeldner/cats/teams","hooks_url":"https://api.github.com/repos/rsoeldner/cats/hooks","issue_events_url":"https://api.github.com/repos/rsoeldner/cats/issues/events{/number}","events_url":"https://api.github.com/repos/rsoeldner/cats/events","assignees_url":"https://api.github.com/repos/rsoeldner/cats/assignees{/user}","branches_url":"https://api.github.com/repos/rsoeldner/cats/branches{/branch}","tags_url":"https://api.github.com/repos/rsoeldner/cats/tags","blobs_url":"https://api.github.com/repos/rsoeldner/cats/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rsoeldner/cats/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rsoeldner/cats/git/refs{/sha}","trees_url":"https://api.github.com/repos/rsoeldner/cats/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rsoeldner/cats/statuses/{sha}","languages_url":"https://api.github.com/repos/rsoeldner/cats/languages","stargazers_url":"https://api.github.com/repos/rsoeldner/cats/stargazers","contributors_url":"https://api.github.com/repos/rsoeldner/cats/contributors","subscribers_url":"https://api.github.com/repos/rsoeldner/cats/subscribers","subscription_url":"https://api.github.com/repos/rsoeldner/cats/subscription","commits_url":"https://api.github.com/repos/rsoeldner/cats/commits{/sha}","git_commits_url":"https://api.github.com/repos/rsoeldner/cats/git/commits{/sha}","comments_url":"https://api.github.com/repos/rsoeldner/cats/comments{/number}","issue_comment_url":"https://api.github.com/repos/rsoeldner/cats/issues/comments{/number}","contents_url":"https://api.github.com/repos/rsoeldner/cats/contents/{+path}","compare_url":"https://api.github.com/repos/rsoeldner/cats/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rsoeldner/cats/merges","archive_url":"https://api.github.com/repos/rsoeldner/cats/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rsoeldner/cats/downloads","issues_url":"https://api.github.com/repos/rsoeldner/cats/issues{/number}","pulls_url":"https://api.github.com/repos/rsoeldner/cats/pulls{/number}","milestones_url":"https://api.github.com/repos/rsoeldner/cats/milestones{/number}","notifications_url":"https://api.github.com/repos/rsoeldner/cats/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rsoeldner/cats/labels{/name}","releases_url":"https://api.github.com/repos/rsoeldner/cats/releases{/id}","deployments_url":"https://api.github.com/repos/rsoeldner/cats/deployments","created_at":"2017-11-24T17:39:25Z","updated_at":"2017-11-24T17:39:28Z","pushed_at":"2018-03-09T04:04:53Z","git_url":"git://github.com/rsoeldner/cats.git","ssh_url":"git@github.com:rsoeldner/cats.git","clone_url":"https://github.com/rsoeldner/cats.git","svn_url":"https://github.com/rsoeldner/cats","homepage":"http://typelevel.org/cats/","size":21406,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"typelevel:master","ref":"master","sha":"5051b369571d54fba0805e72836b71335ce611d5","user":{"login":"typelevel","id":3731824,"avatar_url":"https://avatars0.githubusercontent.com/u/3731824?v=4","gravatar_id":"","url":"https://api.github.com/users/typelevel","html_url":"https://github.com/typelevel","followers_url":"https://api.github.com/users/typelevel/followers","following_url":"https://api.github.com/users/typelevel/following{/other_user}","gists_url":"https://api.github.com/users/typelevel/gists{/gist_id}","starred_url":"https://api.github.com/users/typelevel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/typelevel/subscriptions","organizations_url":"https://api.github.com/users/typelevel/orgs","repos_url":"https://api.github.com/users/typelevel/repos","events_url":"https://api.github.com/users/typelevel/events{/privacy}","received_events_url":"https://api.github.com/users/typelevel/received_events","type":"Organization","site_admin":false},"repo":{"id":29986727,"name":"cats","full_name":"typelevel/cats","owner":{"login":"typelevel","id":3731824,"avatar_url":"https://avatars0.githubusercontent.com/u/3731824?v=4","gravatar_id":"","url":"https://api.github.com/users/typelevel","html_url":"https://github.com/typelevel","followers_url":"https://api.github.com/users/typelevel/followers","following_url":"https://api.github.com/users/typelevel/following{/other_user}","gists_url":"https://api.github.com/users/typelevel/gists{/gist_id}","starred_url":"https://api.github.com/users/typelevel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/typelevel/subscriptions","organizations_url":"https://api.github.com/users/typelevel/orgs","repos_url":"https://api.github.com/users/typelevel/repos","events_url":"https://api.github.com/users/typelevel/events{/privacy}","received_events_url":"https://api.github.com/users/typelevel/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/typelevel/cats","description":"Lightweight, modular, and extensible library for functional programming.","fork":false,"url":"https://api.github.com/repos/typelevel/cats","forks_url":"https://api.github.com/repos/typelevel/cats/forks","keys_url":"https://api.github.com/repos/typelevel/cats/keys{/key_id}","collaborators_url":"https://api.github.com/repos/typelevel/cats/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/typelevel/cats/teams","hooks_url":"https://api.github.com/repos/typelevel/cats/hooks","issue_events_url":"https://api.github.com/repos/typelevel/cats/issues/events{/number}","events_url":"https://api.github.com/repos/typelevel/cats/events","assignees_url":"https://api.github.com/repos/typelevel/cats/assignees{/user}","branches_url":"https://api.github.com/repos/typelevel/cats/branches{/branch}","tags_url":"https://api.github.com/repos/typelevel/cats/tags","blobs_url":"https://api.github.com/repos/typelevel/cats/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/typelevel/cats/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/typelevel/cats/git/refs{/sha}","trees_url":"https://api.github.com/repos/typelevel/cats/git/trees{/sha}","statuses_url":"https://api.github.com/repos/typelevel/cats/statuses/{sha}","languages_url":"https://api.github.com/repos/typelevel/cats/languages","stargazers_url":"https://api.github.com/repos/typelevel/cats/stargazers","contributors_url":"https://api.github.com/repos/typelevel/cats/contributors","subscribers_url":"https://api.github.com/repos/typelevel/cats/subscribers","subscription_url":"https://api.github.com/repos/typelevel/cats/subscription","commits_url":"https://api.github.com/repos/typelevel/cats/commits{/sha}","git_commits_url":"https://api.github.com/repos/typelevel/cats/git/commits{/sha}","comments_url":"https://api.github.com/repos/typelevel/cats/comments{/number}","issue_comment_url":"https://api.github.com/repos/typelevel/cats/issues/comments{/number}","contents_url":"https://api.github.com/repos/typelevel/cats/contents/{+path}","compare_url":"https://api.github.com/repos/typelevel/cats/compare/{base}...{head}","merges_url":"https://api.github.com/repos/typelevel/cats/merges","archive_url":"https://api.github.com/repos/typelevel/cats/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/typelevel/cats/downloads","issues_url":"https://api.github.com/repos/typelevel/cats/issues{/number}","pulls_url":"https://api.github.com/repos/typelevel/cats/pulls{/number}","milestones_url":"https://api.github.com/repos/typelevel/cats/milestones{/number}","notifications_url":"https://api.github.com/repos/typelevel/cats/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/typelevel/cats/labels{/name}","releases_url":"https://api.github.com/repos/typelevel/cats/releases{/id}","deployments_url":"https://api.github.com/repos/typelevel/cats/deployments","created_at":"2015-01-28T20:26:48Z","updated_at":"2018-03-14T15:27:32Z","pushed_at":"2018-03-14T15:27:25Z","git_url":"git://github.com/typelevel/cats.git","ssh_url":"git@github.com:typelevel/cats.git","clone_url":"https://github.com/typelevel/cats.git","svn_url":"https://github.com/typelevel/cats","homepage":"http://typelevel.org/cats/","size":23004,"stargazers_count":2376,"watchers_count":2376,"language":"Scala","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":571,"mirror_url":null,"archived":false,"open_issues_count":230,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":571,"open_issues":230,"watchers":2376,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/typelevel/cats/pulls/2123"},"html":{"href":"https://github.com/typelevel/cats/pull/2123"},"issue":{"href":"https://api.github.com/repos/typelevel/cats/issues/2123"},"comments":{"href":"https://api.github.com/repos/typelevel/cats/issues/2123/comments"},"review_comments":{"href":"https://api.github.com/repos/typelevel/cats/pulls/2123/comments"},"review_comment":{"href":"https://api.github.com/repos/typelevel/cats/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/typelevel/cats/pulls/2123/commits"},"statuses":{"href":"https://api.github.com/repos/typelevel/cats/statuses/c74ac49a49345f2a25eaa782d46e917ac5c2af3f"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"johnynek"}}