-
Notifications
You must be signed in to change notification settings - Fork 139
Description
The More details section for impl Trait
describes the type theoretic meaning of impl Trait
in terms of existential types.
type parameters and
impl Trait
in argument position are universals (universally quantified types). Meanwhile,impl
Trait in return position are existentials (existentially quantified types).
This is not quite right: argument-position impl Trait
is also existentially-quantified, but is isomorphic to another universally-quantified type (as described here).
At the very least this explanation should be modified. Better still, all mention of existentially-quantified types could be removed entirely, as explaining impl Trait
in terms of existential types has time and time again proven to cause more confusion than it resolves. The intuitive explanations earlier do a better job of describing impl Trait
.