{"action":"created","issue":{"url":"https://api.github.com/repos/typelevel/cats/issues/1192","repository_url":"https://api.github.com/repos/typelevel/cats","labels_url":"https://api.github.com/repos/typelevel/cats/issues/1192/labels{/name}","comments_url":"https://api.github.com/repos/typelevel/cats/issues/1192/comments","events_url":"https://api.github.com/repos/typelevel/cats/issues/1192/events","html_url":"https://github.com/typelevel/cats/issues/1192","id":165393776,"number":1192,"title":"data.Xor and instances/either.scala: Either is now right-biased","user":{"login":"soc","id":42493,"avatar_url":"https://avatars.githubusercontent.com/u/42493?v=3","gravatar_id":"","url":"https://api.github.com/users/soc","html_url":"https://github.com/soc","followers_url":"https://api.github.com/users/soc/followers","following_url":"https://api.github.com/users/soc/following{/other_user}","gists_url":"https://api.github.com/users/soc/gists{/gist_id}","starred_url":"https://api.github.com/users/soc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soc/subscriptions","organizations_url":"https://api.github.com/users/soc/orgs","repos_url":"https://api.github.com/users/soc/repos","events_url":"https://api.github.com/users/soc/events{/privacy}","received_events_url":"https://api.github.com/users/soc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/typelevel/cats/milestones/2","html_url":"https://github.com/typelevel/cats/milestones/cats-1.0.0","labels_url":"https://api.github.com/repos/typelevel/cats/milestones/2/labels","id":1201589,"number":2,"title":"cats-1.0.0","description":"","creator":{"login":"ceedubs","id":977929,"avatar_url":"https://avatars.githubusercontent.com/u/977929?v=3","gravatar_id":"","url":"https://api.github.com/users/ceedubs","html_url":"https://github.com/ceedubs","followers_url":"https://api.github.com/users/ceedubs/followers","following_url":"https://api.github.com/users/ceedubs/following{/other_user}","gists_url":"https://api.github.com/users/ceedubs/gists{/gist_id}","starred_url":"https://api.github.com/users/ceedubs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ceedubs/subscriptions","organizations_url":"https://api.github.com/users/ceedubs/orgs","repos_url":"https://api.github.com/users/ceedubs/repos","events_url":"https://api.github.com/users/ceedubs/events{/privacy}","received_events_url":"https://api.github.com/users/ceedubs/received_events","type":"User","site_admin":false},"open_issues":14,"closed_issues":17,"state":"open","created_at":"2015-07-09T22:28:28Z","updated_at":"2016-08-07T20:49:21Z","due_on":null,"closed_at":null},"comments":19,"created_at":"2016-07-13T18:48:05Z","updated_at":"2016-08-08T03:57:36Z","closed_at":null,"body":"Either has become right-biased in Scala 2.12, so I think it would make sense to\r\n\r\n- check whether instances/either.scala can be cleaned up/stream-lined\r\n- consider whether keeping `Xor` has benefits that are greater than converging on a single `Either` implementation in the Scala ecosystem"},"comment":{"url":"https://api.github.com/repos/typelevel/cats/issues/comments/238136990","html_url":"https://github.com/typelevel/cats/issues/1192#issuecomment-238136990","issue_url":"https://api.github.com/repos/typelevel/cats/issues/1192","id":238136990,"user":{"login":"rossabaker","id":142698,"avatar_url":"https://avatars.githubusercontent.com/u/142698?v=3","gravatar_id":"","url":"https://api.github.com/users/rossabaker","html_url":"https://github.com/rossabaker","followers_url":"https://api.github.com/users/rossabaker/followers","following_url":"https://api.github.com/users/rossabaker/following{/other_user}","gists_url":"https://api.github.com/users/rossabaker/gists{/gist_id}","starred_url":"https://api.github.com/users/rossabaker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rossabaker/subscriptions","organizations_url":"https://api.github.com/users/rossabaker/orgs","repos_url":"https://api.github.com/users/rossabaker/repos","events_url":"https://api.github.com/users/rossabaker/events{/privacy}","received_events_url":"https://api.github.com/users/rossabaker/received_events","type":"User","site_admin":false},"created_at":"2016-08-08T03:57:35Z","updated_at":"2016-08-08T03:57:35Z","body":"`batteries` is a concept to reduce branch divergence while I attempt to support http4s on two stacks for a bit.  Here it is with more traditional a la carte imports (Scala 2.11.8, cats 0.6.1):\r\n\r\n```scala\r\nscala> object EitherSyntax { // this would be added to cats\r\n     |   implicit class EitherOps[A, B](self: Either[A, B]) {\r\n     |     def map[C](f: B => C) = self.fold(Left(_), b => Right(f(b)))\r\n     |   }\r\n     | }\r\ndefined object EitherSyntax\r\n\r\nscala> import cats.std.either._, cats.syntax.functor._, EitherSyntax._\r\nimport cats.std.either._\r\nimport cats.syntax.functor._\r\nimport EitherSyntax._\r\n\r\nscala> Right(5).map(_ * 2)\r\nres0: Product with Serializable with scala.util.Either[Nothing,Int] = Right(10)\r\n\r\nscala> type ParseResult[+A] = Either[String, A]\r\ndefined type alias ParseResult\r\n\r\nscala> (Right(5): ParseResult[Int]).map(_ * 2)\r\n<console>:23: error: type mismatch;\r\n found   : ParseResult[Int]\r\n    (which expands to)  scala.util.Either[String,Int]\r\n required: ?{def map: ?}\r\nNote that implicit conversions are not applicable because they are ambiguous:\r\n both method toFunctorOps in trait ToFunctorOps of type [F[_], A](target: F[A])(implicit tc: cats.Functor[F])cats.Functor.Ops[F,A]\r\n and method EitherOps in object EitherSyntax of type [A, B](self: Either[A,B])EitherSyntax.EitherOps[A,B]\r\n are possible conversion functions from ParseResult[Int] to ?{def map: ?}\r\n       (Right(5): ParseResult[Int]).map(_ * 2)\r\n                ^\r\nscala> type Disjunction[+A, +B] = Either[A, B]\r\ndefined type alias Disjunction\r\n\r\nscala> (Right(5): Disjunction[Nothing, Int]).map(_ * 2)\r\nres3: Product with Serializable with scala.util.Either[Nothing,Int] = Right(10)\r\n```\r\n\r\nThis is only going to bite people not using SI-2712, supporting Scala < 2.12, with `_[_]` type aliases for `Either`.  This might be a small population, but it bit me almost immediately."}}
{"actor":{"display_login":"rossabaker"}}