{"action":"created","issue":{"url":"https://api.github.com/repos/alexcrichton/futures-rs/issues/120","repository_url":"https://api.github.com/repos/alexcrichton/futures-rs","labels_url":"https://api.github.com/repos/alexcrichton/futures-rs/issues/120/labels{/name}","comments_url":"https://api.github.com/repos/alexcrichton/futures-rs/issues/120/comments","events_url":"https://api.github.com/repos/alexcrichton/futures-rs/issues/120/events","html_url":"https://github.com/alexcrichton/futures-rs/issues/120","id":174645528,"number":120,"title":"Consider type parameters instead of associated items","user":{"login":"alexcrichton","id":64996,"avatar_url":"https://avatars.githubusercontent.com/u/64996?v=3","gravatar_id":"","url":"https://api.github.com/users/alexcrichton","html_url":"https://github.com/alexcrichton","followers_url":"https://api.github.com/users/alexcrichton/followers","following_url":"https://api.github.com/users/alexcrichton/following{/other_user}","gists_url":"https://api.github.com/users/alexcrichton/gists{/gist_id}","starred_url":"https://api.github.com/users/alexcrichton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexcrichton/subscriptions","organizations_url":"https://api.github.com/users/alexcrichton/orgs","repos_url":"https://api.github.com/users/alexcrichton/repos","events_url":"https://api.github.com/users/alexcrichton/events{/privacy}","received_events_url":"https://api.github.com/users/alexcrichton/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-09-01T23:02:02Z","updated_at":"2016-09-02T16:22:44Z","closed_at":null,"body":"For example, this definition of `Future` instead:\r\n\r\n```rust\r\ntrait Future<T, E> {\r\n    // ...\r\n}\r\n```\r\n\r\nThe pros of this approach are:\r\n\r\n* `Future<T, E>` is more ergonomic than `Future<Item=T, Error=E>`\r\n\r\nThe cons of this approach are:\r\n\r\n* More type parameters when working generically\r\n\r\nWe expect the vast majority of future consumers to *not* be working generically but rather with `Future` directly with concrete types, and we also expect trait objects and/or `impl Trait` to be very common. We should test and see if type parameters are too onerous or not."},"comment":{"url":"https://api.github.com/repos/alexcrichton/futures-rs/issues/comments/244421928","html_url":"https://github.com/alexcrichton/futures-rs/issues/120#issuecomment-244421928","issue_url":"https://api.github.com/repos/alexcrichton/futures-rs/issues/120","id":244421928,"user":{"login":"sinkuu","id":7091080,"avatar_url":"https://avatars.githubusercontent.com/u/7091080?v=3","gravatar_id":"","url":"https://api.github.com/users/sinkuu","html_url":"https://github.com/sinkuu","followers_url":"https://api.github.com/users/sinkuu/followers","following_url":"https://api.github.com/users/sinkuu/following{/other_user}","gists_url":"https://api.github.com/users/sinkuu/gists{/gist_id}","starred_url":"https://api.github.com/users/sinkuu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sinkuu/subscriptions","organizations_url":"https://api.github.com/users/sinkuu/orgs","repos_url":"https://api.github.com/users/sinkuu/repos","events_url":"https://api.github.com/users/sinkuu/events{/privacy}","received_events_url":"https://api.github.com/users/sinkuu/received_events","type":"User","site_admin":false},"created_at":"2016-09-02T16:22:44Z","updated_at":"2016-09-02T16:22:44Z","body":"> That the additional trait bound makes this not work might be a bug in the implementation: A concrete type surely looks like it should always be more specific than a variable, trait-bound or not.\r\n\r\nIIUC, `F : Future<T, E>` is not a super set of `Result<T, E>` (we can't say `Result<T, E>: Future<T, E>`) so you can't use specialization with that trait bound.\r\nThen it runs into a coherence error: https://github.com/rust-lang/rust/issues/28881 (exactly equivalent - `Base` = `Future`, `Foo` = `IntoFuture`, `Bar` = `Result`). Compiler doesn't consider `std` is an upstream crate here."}}
{"actor":{"display_login":"sinkuu"}}