{"action":"created","issue":{"url":"https://api.github.com/repos/antitypical/Result/issues/67","labels_url":"https://api.github.com/repos/antitypical/Result/issues/67/labels{/name}","comments_url":"https://api.github.com/repos/antitypical/Result/issues/67/comments","events_url":"https://api.github.com/repos/antitypical/Result/issues/67/events","html_url":"https://github.com/antitypical/Result/pull/67","id":88825194,"number":67,"title":"Add ResultType protocol to facilitate protocol extension constraints","user":{"login":"Thomvis","id":134170,"avatar_url":"https://avatars.githubusercontent.com/u/134170?v=3","gravatar_id":"","url":"https://api.github.com/users/Thomvis","html_url":"https://github.com/Thomvis","followers_url":"https://api.github.com/users/Thomvis/followers","following_url":"https://api.github.com/users/Thomvis/following{/other_user}","gists_url":"https://api.github.com/users/Thomvis/gists{/gist_id}","starred_url":"https://api.github.com/users/Thomvis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Thomvis/subscriptions","organizations_url":"https://api.github.com/users/Thomvis/orgs","repos_url":"https://api.github.com/users/Thomvis/repos","events_url":"https://api.github.com/users/Thomvis/events{/privacy}","received_events_url":"https://api.github.com/users/Thomvis/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-06-16T19:55:20Z","updated_at":"2015-06-20T00:34:09Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/antitypical/Result/pulls/67","html_url":"https://github.com/antitypical/Result/pull/67","diff_url":"https://github.com/antitypical/Result/pull/67.diff","patch_url":"https://github.com/antitypical/Result/pull/67.patch"},"body":"Protocols are really powerful in Swift and with Swift 2.0 even more so. By adding the `ResultType` protocol, we can use the type in protocol extensions and in generic constraints.\r\n\r\nThe primary motivation for this PR is a refactoring of BrightFutures (which has Result as a dependency) that I am working on. With the help of the `ResultType` protocol, I can define a simple `Deferred<T>` type and add methods (such as `onSuccess` and `onFailure`) to it when `T: ResultType`. \r\n- Relevant code in BrightFutures: https://gist.github.com/Thomvis/0684c36159d173396297ub.com/Thomvis/BrightFutures/blob/swiftier-2.0/BrightFutures/Future.swift#L112\r\n- Concise example:  https://gist.github.com/Thomvis/0684c36159d173396297\r\n\r\nThe contents of the protocol is debatable, but the current contents are the parts that I found helpful.\r\n\r\n:star2: Let me know what you think!"},"comment":{"url":"https://api.github.com/repos/antitypical/Result/issues/comments/113686532","html_url":"https://github.com/antitypical/Result/pull/67#issuecomment-113686532","issue_url":"https://api.github.com/repos/antitypical/Result/issues/67","id":113686532,"user":{"login":"mdiep","id":1302,"avatar_url":"https://avatars.githubusercontent.com/u/1302?v=3","gravatar_id":"","url":"https://api.github.com/users/mdiep","html_url":"https://github.com/mdiep","followers_url":"https://api.github.com/users/mdiep/followers","following_url":"https://api.github.com/users/mdiep/following{/other_user}","gists_url":"https://api.github.com/users/mdiep/gists{/gist_id}","starred_url":"https://api.github.com/users/mdiep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdiep/subscriptions","organizations_url":"https://api.github.com/users/mdiep/orgs","repos_url":"https://api.github.com/users/mdiep/repos","events_url":"https://api.github.com/users/mdiep/events{/privacy}","received_events_url":"https://api.github.com/users/mdiep/received_events","type":"User","site_admin":true},"created_at":"2015-06-20T00:34:09Z","updated_at":"2015-06-20T00:34:09Z","body":"I'm sad that a protocol is required to do this, but very :+1: on what it enables."}}