{"action":"created","issue":{"url":"https://api.github.com/repos/Alamofire/Alamofire/issues/1072","repository_url":"https://api.github.com/repos/Alamofire/Alamofire","labels_url":"https://api.github.com/repos/Alamofire/Alamofire/issues/1072/labels{/name}","comments_url":"https://api.github.com/repos/Alamofire/Alamofire/issues/1072/comments","events_url":"https://api.github.com/repos/Alamofire/Alamofire/issues/1072/events","html_url":"https://github.com/Alamofire/Alamofire/issues/1072","id":134895310,"number":1072,"title":"No map support on Result","user":{"login":"KingOfBrian","id":114322,"avatar_url":"https://avatars.githubusercontent.com/u/114322?v=3","gravatar_id":"","url":"https://api.github.com/users/KingOfBrian","html_url":"https://github.com/KingOfBrian","followers_url":"https://api.github.com/users/KingOfBrian/followers","following_url":"https://api.github.com/users/KingOfBrian/following{/other_user}","gists_url":"https://api.github.com/users/KingOfBrian/gists{/gist_id}","starred_url":"https://api.github.com/users/KingOfBrian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KingOfBrian/subscriptions","organizations_url":"https://api.github.com/users/KingOfBrian/orgs","repos_url":"https://api.github.com/users/KingOfBrian/repos","events_url":"https://api.github.com/users/KingOfBrian/events{/privacy}","received_events_url":"https://api.github.com/users/KingOfBrian/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Alamofire/Alamofire/labels/needs%20feedback","name":"needs feedback","color":"9559F0"},{"url":"https://api.github.com/repos/Alamofire/Alamofire/labels/result","name":"result","color":"69B805"}],"state":"closed","locked":false,"assignee":{"login":"cnoon","id":169110,"avatar_url":"https://avatars.githubusercontent.com/u/169110?v=3","gravatar_id":"","url":"https://api.github.com/users/cnoon","html_url":"https://github.com/cnoon","followers_url":"https://api.github.com/users/cnoon/followers","following_url":"https://api.github.com/users/cnoon/following{/other_user}","gists_url":"https://api.github.com/users/cnoon/gists{/gist_id}","starred_url":"https://api.github.com/users/cnoon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cnoon/subscriptions","organizations_url":"https://api.github.com/users/cnoon/orgs","repos_url":"https://api.github.com/users/cnoon/repos","events_url":"https://api.github.com/users/cnoon/events{/privacy}","received_events_url":"https://api.github.com/users/cnoon/received_events","type":"User","site_admin":false},"milestone":null,"comments":5,"created_at":"2016-02-19T15:41:44Z","updated_at":"2016-03-05T21:15:05Z","closed_at":"2016-02-27T17:25:39Z","body":"I'm looking to use map on a Result to clean up some of my error processing in my response callback. Would a PR with map support be something that this project would like to include?"},"comment":{"url":"https://api.github.com/repos/Alamofire/Alamofire/issues/comments/192739252","html_url":"https://github.com/Alamofire/Alamofire/issues/1072#issuecomment-192739252","issue_url":"https://api.github.com/repos/Alamofire/Alamofire/issues/1072","id":192739252,"user":{"login":"KingOfBrian","id":114322,"avatar_url":"https://avatars.githubusercontent.com/u/114322?v=3","gravatar_id":"","url":"https://api.github.com/users/KingOfBrian","html_url":"https://github.com/KingOfBrian","followers_url":"https://api.github.com/users/KingOfBrian/followers","following_url":"https://api.github.com/users/KingOfBrian/following{/other_user}","gists_url":"https://api.github.com/users/KingOfBrian/gists{/gist_id}","starred_url":"https://api.github.com/users/KingOfBrian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KingOfBrian/subscriptions","organizations_url":"https://api.github.com/users/KingOfBrian/orgs","repos_url":"https://api.github.com/users/KingOfBrian/repos","events_url":"https://api.github.com/users/KingOfBrian/events{/privacy}","received_events_url":"https://api.github.com/users/KingOfBrian/received_events","type":"User","site_admin":false},"created_at":"2016-03-05T21:15:05Z","updated_at":"2016-03-05T21:15:05Z","body":"Sorry for the late follow up, but this is the sort of behavior that I'd like:\r\n\r\n```swift\r\nrequest.responseJSON() { response in\r\n    let modelResult = response.result.map { value in\r\n        guard\r\n            let json = value as? Dictionary<String, AnyObject>,\r\n            let token = json[\"token\"] as? String,\r\n            let refreshToken = json[\"refresh_token\"] as? String\r\n            else\r\n        {\r\n            return .Failure(ServiceError.errorWithCode(.InvalidResponseContent))\r\n        }\r\n        return OAuthResponse(token, refreshToken)\r\n    }\r\n```\r\nIt's just slightly nicer than checking for error in this case, but as there are multiple transformations reads much better. I agree with you on project dependencies btw, but I think the map behavior in the atypical result object could be copied over here pretty easily.\r\n\r\n"}}