{"action":"created","comment":{"url":"https://api.github.com/repos/typelevel/cats/pulls/comments/218642571","pull_request_review_id":156626675,"id":218642571,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxODY0MjU3MQ==","diff_hunk":"@@ -62,4 +62,33 @@ class ApplicativeErrorSuite extends CatsSuite {\n       (().raiseError[OptionWrapper, Int] orElse OptionWrapper(17.some)).option should === (OptionWrapper(17.some).option)\n     }\n   }\n+\n+  {\n+    sealed trait Super\n+    case object Sub extends Super\n+\n+    final case class EitherWrapper[A](either: Either[Super, A])\n+\n+    implicit val eitherWrapperApplicativeError: ApplicativeError[EitherWrapper, Super] = {\n+      val ev = ApplicativeError[Either[Super, ?], Super]\n+      new ApplicativeError[EitherWrapper, Super] {\n+\n+        def raiseError[A](e: Super): EitherWrapper[A] =\n+          EitherWrapper(ev.raiseError(e))\n+\n+        def handleErrorWith[A](fa: EitherWrapper[A])(f: Super => EitherWrapper[A]): EitherWrapper[A] =\n+          EitherWrapper(ev.handleErrorWith(fa.either)(f(_).either))\n+\n+        def pure[A](x: A): EitherWrapper[A] =\n+          EitherWrapper(x.asRight)\n+\n+        def ap[A, B](ff: EitherWrapper[A => B])(fa: EitherWrapper[A]): EitherWrapper[B] =\n+          EitherWrapper(ev.ap(ff.either)(fa.either))\n+      }\n+    }\n+\n+    test(\"raiseError syntax allows an error subtype\") {\n+      assert(Sub.raiseError[EitherWrapper, Unit].either.isLeft)","path":"tests/src/test/scala/cats/tests/ApplicativeErrorSuite.scala","position":30,"original_position":30,"commit_id":"bdf9f9e94cd6ddac07eea5e5dce41d0668ebb57d","original_commit_id":"9813b3661427d5722c19b680b47c80629d4525e4","user":{"login":"guersam","id":969120,"node_id":"MDQ6VXNlcjk2OTEyMA==","avatar_url":"https://avatars3.githubusercontent.com/u/969120?v=4","gravatar_id":"","url":"https://api.github.com/users/guersam","html_url":"https://github.com/guersam","followers_url":"https://api.github.com/users/guersam/followers","following_url":"https://api.github.com/users/guersam/following{/other_user}","gists_url":"https://api.github.com/users/guersam/gists{/gist_id}","starred_url":"https://api.github.com/users/guersam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guersam/subscriptions","organizations_url":"https://api.github.com/users/guersam/orgs","repos_url":"https://api.github.com/users/guersam/repos","events_url":"https://api.github.com/users/guersam/events{/privacy}","received_events_url":"https://api.github.com/users/guersam/received_events","type":"User","site_admin":false},"body":"That's much better! I'll take it and move to `SyntaxSuite`.","created_at":"2018-09-19T01:19:17Z","updated_at":"2018-09-19T01:19:17Z","html_url":"https://github.com/typelevel/cats/pull/2511#discussion_r218642571","pull_request_url":"https://api.github.com/repos/typelevel/cats/pulls/2511","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/typelevel/cats/pulls/comments/218642571"},"html":{"href":"https://github.com/typelevel/cats/pull/2511#discussion_r218642571"},"pull_request":{"href":"https://api.github.com/repos/typelevel/cats/pulls/2511"}},"in_reply_to_id":218301751},"pull_request":{"url":"https://api.github.com/repos/typelevel/cats/pulls/2511","id":216185952,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE2MTg1OTUy","html_url":"https://github.com/typelevel/cats/pull/2511","diff_url":"https://github.com/typelevel/cats/pull/2511.diff","patch_url":"https://github.com/typelevel/cats/pull/2511.patch","issue_url":"https://api.github.com/repos/typelevel/cats/issues/2511","number":2511,"state":"open","locked":false,"title":".raiseError syntax allows an error subtype","user":{"login":"guersam","id":969120,"node_id":"MDQ6VXNlcjk2OTEyMA==","avatar_url":"https://avatars3.githubusercontent.com/u/969120?v=4","gravatar_id":"","url":"https://api.github.com/users/guersam","html_url":"https://github.com/guersam","followers_url":"https://api.github.com/users/guersam/followers","following_url":"https://api.github.com/users/guersam/following{/other_user}","gists_url":"https://api.github.com/users/guersam/gists{/gist_id}","starred_url":"https://api.github.com/users/guersam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guersam/subscriptions","organizations_url":"https://api.github.com/users/guersam/orgs","repos_url":"https://api.github.com/users/guersam/repos","events_url":"https://api.github.com/users/guersam/events{/privacy}","received_events_url":"https://api.github.com/users/guersam/received_events","type":"User","site_admin":false},"body":"Inspired by #2480, applying the same trick to `.raiseError` so that I can write `MyException(...).raiseError[IO, Unit]`, instead of `(MyException(...): Throwable).raiseError[IO, Unit]`.","created_at":"2018-09-18T05:21:49Z","updated_at":"2018-09-19T01:19:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"708eeb6f757f49136335a4835a434e8f54cd0923","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/typelevel/cats/pulls/2511/commits","review_comments_url":"https://api.github.com/repos/typelevel/cats/pulls/2511/comments","review_comment_url":"https://api.github.com/repos/typelevel/cats/pulls/comments{/number}","comments_url":"https://api.github.com/repos/typelevel/cats/issues/2511/comments","statuses_url":"https://api.github.com/repos/typelevel/cats/statuses/bdf9f9e94cd6ddac07eea5e5dce41d0668ebb57d","head":{"label":"guersam:guersam/raiseerror-syntax-subtype","ref":"guersam/raiseerror-syntax-subtype","sha":"bdf9f9e94cd6ddac07eea5e5dce41d0668ebb57d","user":{"login":"guersam","id":969120,"node_id":"MDQ6VXNlcjk2OTEyMA==","avatar_url":"https://avatars3.githubusercontent.com/u/969120?v=4","gravatar_id":"","url":"https://api.github.com/users/guersam","html_url":"https://github.com/guersam","followers_url":"https://api.github.com/users/guersam/followers","following_url":"https://api.github.com/users/guersam/following{/other_user}","gists_url":"https://api.github.com/users/guersam/gists{/gist_id}","starred_url":"https://api.github.com/users/guersam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guersam/subscriptions","organizations_url":"https://api.github.com/users/guersam/orgs","repos_url":"https://api.github.com/users/guersam/repos","events_url":"https://api.github.com/users/guersam/events{/privacy}","received_events_url":"https://api.github.com/users/guersam/received_events","type":"User","site_admin":false},"repo":{"id":40588003,"node_id":"MDEwOlJlcG9zaXRvcnk0MDU4ODAwMw==","name":"cats","full_name":"guersam/cats","private":false,"owner":{"login":"guersam","id":969120,"node_id":"MDQ6VXNlcjk2OTEyMA==","avatar_url":"https://avatars3.githubusercontent.com/u/969120?v=4","gravatar_id":"","url":"https://api.github.com/users/guersam","html_url":"https://github.com/guersam","followers_url":"https://api.github.com/users/guersam/followers","following_url":"https://api.github.com/users/guersam/following{/other_user}","gists_url":"https://api.github.com/users/guersam/gists{/gist_id}","starred_url":"https://api.github.com/users/guersam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guersam/subscriptions","organizations_url":"https://api.github.com/users/guersam/orgs","repos_url":"https://api.github.com/users/guersam/repos","events_url":"https://api.github.com/users/guersam/events{/privacy}","received_events_url":"https://api.github.com/users/guersam/received_events","type":"User","site_admin":false},"html_url":"https://github.com/guersam/cats","description":"Lightweight, modular, and extensible library for functional programming.","fork":true,"url":"https://api.github.com/repos/guersam/cats","forks_url":"https://api.github.com/repos/guersam/cats/forks","keys_url":"https://api.github.com/repos/guersam/cats/keys{/key_id}","collaborators_url":"https://api.github.com/repos/guersam/cats/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/guersam/cats/teams","hooks_url":"https://api.github.com/repos/guersam/cats/hooks","issue_events_url":"https://api.github.com/repos/guersam/cats/issues/events{/number}","events_url":"https://api.github.com/repos/guersam/cats/events","assignees_url":"https://api.github.com/repos/guersam/cats/assignees{/user}","branches_url":"https://api.github.com/repos/guersam/cats/branches{/branch}","tags_url":"https://api.github.com/repos/guersam/cats/tags","blobs_url":"https://api.github.com/repos/guersam/cats/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/guersam/cats/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/guersam/cats/git/refs{/sha}","trees_url":"https://api.github.com/repos/guersam/cats/git/trees{/sha}","statuses_url":"https://api.github.com/repos/guersam/cats/statuses/{sha}","languages_url":"https://api.github.com/repos/guersam/cats/languages","stargazers_url":"https://api.github.com/repos/guersam/cats/stargazers","contributors_url":"https://api.github.com/repos/guersam/cats/contributors","subscribers_url":"https://api.github.com/repos/guersam/cats/subscribers","subscription_url":"https://api.github.com/repos/guersam/cats/subscription","commits_url":"https://api.github.com/repos/guersam/cats/commits{/sha}","git_commits_url":"https://api.github.com/repos/guersam/cats/git/commits{/sha}","comments_url":"https://api.github.com/repos/guersam/cats/comments{/number}","issue_comment_url":"https://api.github.com/repos/guersam/cats/issues/comments{/number}","contents_url":"https://api.github.com/repos/guersam/cats/contents/{+path}","compare_url":"https://api.github.com/repos/guersam/cats/compare/{base}...{head}","merges_url":"https://api.github.com/repos/guersam/cats/merges","archive_url":"https://api.github.com/repos/guersam/cats/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/guersam/cats/downloads","issues_url":"https://api.github.com/repos/guersam/cats/issues{/number}","pulls_url":"https://api.github.com/repos/guersam/cats/pulls{/number}","milestones_url":"https://api.github.com/repos/guersam/cats/milestones{/number}","notifications_url":"https://api.github.com/repos/guersam/cats/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/guersam/cats/labels{/name}","releases_url":"https://api.github.com/repos/guersam/cats/releases{/id}","deployments_url":"https://api.github.com/repos/guersam/cats/deployments","created_at":"2015-08-12T08:01:35Z","updated_at":"2016-01-30T20:32:29Z","pushed_at":"2018-09-18T05:29:02Z","git_url":"git://github.com/guersam/cats.git","ssh_url":"git@github.com:guersam/cats.git","clone_url":"https://github.com/guersam/cats.git","svn_url":"https://github.com/guersam/cats","homepage":"http://non.github.io/cats/","size":9347,"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":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"typelevel:master","ref":"master","sha":"1911e8b1926f98080a6ec79422ad47d948946469","user":{"login":"typelevel","id":3731824,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM3MzE4MjQ=","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,"node_id":"MDEwOlJlcG9zaXRvcnkyOTk4NjcyNw==","name":"cats","full_name":"typelevel/cats","private":false,"owner":{"login":"typelevel","id":3731824,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM3MzE4MjQ=","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},"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-09-18T21:31:22Z","pushed_at":"2018-09-18T22:01:13Z","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":26482,"stargazers_count":2738,"watchers_count":2738,"language":"Scala","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":688,"mirror_url":null,"archived":false,"open_issues_count":274,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":688,"open_issues":274,"watchers":2738,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/typelevel/cats/pulls/2511"},"html":{"href":"https://github.com/typelevel/cats/pull/2511"},"issue":{"href":"https://api.github.com/repos/typelevel/cats/issues/2511"},"comments":{"href":"https://api.github.com/repos/typelevel/cats/issues/2511/comments"},"review_comments":{"href":"https://api.github.com/repos/typelevel/cats/pulls/2511/comments"},"review_comment":{"href":"https://api.github.com/repos/typelevel/cats/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/typelevel/cats/pulls/2511/commits"},"statuses":{"href":"https://api.github.com/repos/typelevel/cats/statuses/bdf9f9e94cd6ddac07eea5e5dce41d0668ebb57d"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"guersam"}}