{"action":"created","issue":{"url":"https://api.github.com/repos/funcool/cats/issues/45","labels_url":"https://api.github.com/repos/funcool/cats/issues/45/labels{/name}","comments_url":"https://api.github.com/repos/funcool/cats/issues/45/comments","events_url":"https://api.github.com/repos/funcool/cats/issues/45/events","html_url":"https://github.com/funcool/cats/pull/45","id":89969669,"number":45,"title":"Add branch-left and branch-right","user":{"login":"yurrriq","id":1866448,"avatar_url":"https://avatars.githubusercontent.com/u/1866448?v=3","gravatar_id":"","url":"https://api.github.com/users/yurrriq","html_url":"https://github.com/yurrriq","followers_url":"https://api.github.com/users/yurrriq/followers","following_url":"https://api.github.com/users/yurrriq/following{/other_user}","gists_url":"https://api.github.com/users/yurrriq/gists{/gist_id}","starred_url":"https://api.github.com/users/yurrriq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yurrriq/subscriptions","organizations_url":"https://api.github.com/users/yurrriq/orgs","repos_url":"https://api.github.com/users/yurrriq/repos","events_url":"https://api.github.com/users/yurrriq/events{/privacy}","received_events_url":"https://api.github.com/users/yurrriq/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-06-21T22:39:08Z","updated_at":"2015-06-21T23:36:43Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/funcool/cats/pulls/45","html_url":"https://github.com/funcool/cats/pull/45","diff_url":"https://github.com/funcool/cats/pull/45.diff","patch_url":"https://github.com/funcool/cats/pull/45.patch"},"body":"When using [cats][1], specifically [the either monad][2], I often find myself writing code like:\r\n\r\n```clojure\r\n(branch either-value\r\n  (fn [value]\r\n    (comment \"Handle a left value\"))\r\n  ;; Pass a right value\r\n  right)\r\n```\r\n\r\nFor this case, I thought it would be better if `(branch e f right)` were abstracted away, and that's precisely what I've done in [`#'cats.monad.either/branch-left`][3].\r\n\r\nIn the interest of symmetry and completeness, I also implemented [`#'cats.monad.either/branch-right`][4], which is effectively an either-specific synonym of [`#'cats.core/bind`][5].\r\n\r\nThe functionality is loosely based on ideas in the [either package][6] for Haskell.\r\nSee also: [`Data.Either.Combinators`][7]\r\n\r\n\r\n[1]: https://github.com/funcool/cats\r\n[2]: https:/github.com/funcool/cats/blob/master/src/cats/monad/either.cljc\r\n[3]: https://github.com/yurrriq/cats/blob/1c21682052ceff254545e23cbd4015ef74b071f8/src/cats/monad/either.cljc#L228-L234\r\n[4]: https://github.com/yurrriq/cats/blob/1c21682052ceff254545e23cbd4015ef74b071f8/src/cats/monad/either.cljc#L236-L242\r\n[5]: https://github.com/funcool/cats/blob/5accd7c937d1cdea9391a828dcdd41e41b6e83f8/src/cats/core.cljc#L117-L139\r\n[6]: https://hackage.haskell.org/package/either-4.4.1\r\n[7]: https://hackage.haskell.org/package/either-4.4.1/docs/Data-Either-Combinators.html\r\n"},"comment":{"url":"https://api.github.com/repos/funcool/cats/issues/comments/113968876","html_url":"https://github.com/funcool/cats/pull/45#issuecomment-113968876","issue_url":"https://api.github.com/repos/funcool/cats/issues/45","id":113968876,"user":{"login":"yurrriq","id":1866448,"avatar_url":"https://avatars.githubusercontent.com/u/1866448?v=3","gravatar_id":"","url":"https://api.github.com/users/yurrriq","html_url":"https://github.com/yurrriq","followers_url":"https://api.github.com/users/yurrriq/followers","following_url":"https://api.github.com/users/yurrriq/following{/other_user}","gists_url":"https://api.github.com/users/yurrriq/gists{/gist_id}","starred_url":"https://api.github.com/users/yurrriq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yurrriq/subscriptions","organizations_url":"https://api.github.com/users/yurrriq/orgs","repos_url":"https://api.github.com/users/yurrriq/repos","events_url":"https://api.github.com/users/yurrriq/events{/privacy}","received_events_url":"https://api.github.com/users/yurrriq/received_events","type":"User","site_admin":false},"created_at":"2015-06-21T23:36:42Z","updated_at":"2015-06-21T23:36:42Z","body":"I'm very open to a suggestion of a better naming convention."}}