{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rfcs/issues/105","labels_url":"https://api.github.com/repos/rust-lang/rfcs/issues/105/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rfcs/issues/105/comments","events_url":"https://api.github.com/repos/rust-lang/rfcs/issues/105/events","html_url":"https://github.com/rust-lang/rfcs/pull/105","id":34910422,"number":105,"title":"RFC: Add unboxed, abstract return types","user":{"login":"aturon","id":709807,"avatar_url":"https://avatars.githubusercontent.com/u/709807?v=3","gravatar_id":"","url":"https://api.github.com/users/aturon","html_url":"https://github.com/aturon","followers_url":"https://api.github.com/users/aturon/followers","following_url":"https://api.github.com/users/aturon/following{/other_user}","gists_url":"https://api.github.com/users/aturon/gists{/gist_id}","starred_url":"https://api.github.com/users/aturon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aturon/subscriptions","organizations_url":"https://api.github.com/users/aturon/orgs","repos_url":"https://api.github.com/users/aturon/repos","events_url":"https://api.github.com/users/aturon/events{/privacy}","received_events_url":"https://api.github.com/users/aturon/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":115,"created_at":"2014-06-03T22:24:29Z","updated_at":"2015-04-17T11:06:46Z","closed_at":"2014-06-06T16:37:41Z","pull_request":{"url":"https://api.github.com/repos/rust-lang/rfcs/pulls/105","html_url":"https://github.com/rust-lang/rfcs/pull/105","diff_url":"https://github.com/rust-lang/rfcs/pull/105.diff","patch_url":"https://github.com/rust-lang/rfcs/pull/105.patch"},"body":""},"comment":{"url":"https://api.github.com/repos/rust-lang/rfcs/issues/comments/93965814","html_url":"https://github.com/rust-lang/rfcs/pull/105#issuecomment-93965814","issue_url":"https://api.github.com/repos/rust-lang/rfcs/issues/105","id":93965814,"user":{"login":"lfairy","id":1572323,"avatar_url":"https://avatars.githubusercontent.com/u/1572323?v=3","gravatar_id":"","url":"https://api.github.com/users/lfairy","html_url":"https://github.com/lfairy","followers_url":"https://api.github.com/users/lfairy/followers","following_url":"https://api.github.com/users/lfairy/following{/other_user}","gists_url":"https://api.github.com/users/lfairy/gists{/gist_id}","starred_url":"https://api.github.com/users/lfairy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lfairy/subscriptions","organizations_url":"https://api.github.com/users/lfairy/orgs","repos_url":"https://api.github.com/users/lfairy/repos","events_url":"https://api.github.com/users/lfairy/events{/privacy}","received_events_url":"https://api.github.com/users/lfairy/received_events","type":"User","site_admin":false},"created_at":"2015-04-17T11:06:46Z","updated_at":"2015-04-17T11:06:46Z","body":"@Stebalien I quite like your third alternative.\r\n\r\nPerhaps rather than using `union`, overload the `type` keyword instead? Something like this:\r\n\r\n```rust\r\ntype MyIterator: Iterator<Item=i32>;\r\ntype MyClosure: FnMut(i32) -> i32;\r\n\r\nfn foo() -> MyIterator {\r\n    range(0, 10)\r\n}\r\n\r\nfn bar() -> Map<i32, MyClosure> {\r\n    foo().map(|x| x + 1)\r\n}\r\n```\r\n\r\nIt works for generics too:\r\n\r\n```rust\r\n// I'm not sure if these lifetimes are correct :\\\r\ntype MyClosure<'a, T>: FnMut(T) -> String + 'a;\r\nfn baz<'a, T: Display, I: Iterator<Item=T>>(prefix: &'a str, items: I) -> Map<T, MyClosure<'a, T>> {\r\n    items.map(|x| format!(\"{}: {}\", prefix, x))\r\n}\r\n```\r\n\r\nThis solution is pretty much equivalent to the original proposal, but solves the naming problem as well. It also has an intuitive reading (\"alias to some unspecified type\").\r\n\r\nThoughts?"}}