{"action":"created","issue":{"url":"https://api.github.com/repos/antitypical/Result/issues/86","labels_url":"https://api.github.com/repos/antitypical/Result/issues/86/labels{/name}","comments_url":"https://api.github.com/repos/antitypical/Result/issues/86/comments","events_url":"https://api.github.com/repos/antitypical/Result/issues/86/events","html_url":"https://github.com/antitypical/Result/pull/86","id":107700947,"number":86,"title":"Move map, flatMap, and &&& to ResultType","user":{"login":"bencochran","id":13990,"avatar_url":"https://avatars.githubusercontent.com/u/13990?v=3","gravatar_id":"","url":"https://api.github.com/users/bencochran","html_url":"https://github.com/bencochran","followers_url":"https://api.github.com/users/bencochran/followers","following_url":"https://api.github.com/users/bencochran/following{/other_user}","gists_url":"https://api.github.com/users/bencochran/gists{/gist_id}","starred_url":"https://api.github.com/users/bencochran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bencochran/subscriptions","organizations_url":"https://api.github.com/users/bencochran/orgs","repos_url":"https://api.github.com/users/bencochran/repos","events_url":"https://api.github.com/users/bencochran/events{/privacy}","received_events_url":"https://api.github.com/users/bencochran/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-09-22T12:03:48Z","updated_at":"2015-09-23T14:22:58Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/antitypical/Result/pulls/86","html_url":"https://github.com/antitypical/Result/pull/86","diff_url":"https://github.com/antitypical/Result/pull/86.diff","patch_url":"https://github.com/antitypical/Result/pull/86.patch"},"body":"As it stand, these can all be implemented in terms of `ResultType`. And doing so opens up the possibilities for more things, like this:\r\n\r\n```swift\r\nextension SequenceType where Generator.Element: ResultType {\r\n    /// Flattens a sequence of Results\r\n    ///\r\n    /// Returns a single Result by combining the values of all `Success`es in this sequence, or re-wrapping the first encountered `Failure`\r\n    func flatten() -> Result<[Generator.Element.Value], Generator.Element.Error> {\r\n        return reduce(.Success([])) { result, element in\r\n            return (result &&& element).map { $0 + [$1] }\r\n        }\r\n    }\r\n}\r\n```\r\n\r\n(which isn’t part of this pull request, but could be if there’s interest)"},"comment":{"url":"https://api.github.com/repos/antitypical/Result/issues/comments/142617158","html_url":"https://github.com/antitypical/Result/pull/86#issuecomment-142617158","issue_url":"https://api.github.com/repos/antitypical/Result/issues/86","id":142617158,"user":{"login":"robrix","id":59671,"avatar_url":"https://avatars.githubusercontent.com/u/59671?v=3","gravatar_id":"","url":"https://api.github.com/users/robrix","html_url":"https://github.com/robrix","followers_url":"https://api.github.com/users/robrix/followers","following_url":"https://api.github.com/users/robrix/following{/other_user}","gists_url":"https://api.github.com/users/robrix/gists{/gist_id}","starred_url":"https://api.github.com/users/robrix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robrix/subscriptions","organizations_url":"https://api.github.com/users/robrix/orgs","repos_url":"https://api.github.com/users/robrix/repos","events_url":"https://api.github.com/users/robrix/events{/privacy}","received_events_url":"https://api.github.com/users/robrix/received_events","type":"User","site_admin":true},"created_at":"2015-09-23T14:22:58Z","updated_at":"2015-09-23T14:22:58Z","body":"@neilpa: Thank you. I’ve been using it a lot lately.\r\n\r\n@Thomvis: That’s correct; there’s a little extra wrapping/unwrapping necessary for now.\r\n\r\nMy main concern here is that when Swift supports higher-rank types (which I’m assuming it will—maybe that’s not a reasonable assumption, though) I would very much want `ResultType.map` to return `Self`. I suppose we would likely be releasing a new major version at that time anyway, however, and thus could change the API at that time. What do we think about viewing this PR as an interim solution?\r\n\r\nThere’s also the question of how many uses of `ResultType` even exist—I suspect there are vanishingly few."}}