Open ExpHP opened 6 years ago
Users should generally not worry about
Index
type parameters. Even when using turbofish syntax (once available), these should generally be left to type inference using_
.
Agreed; Hopefully you won't even need to specify _
in the future with some sort of "partial turbofish" (see my RFC on this -- https://github.com/rust-lang/rfcs/pull/2176) mechanism in the language itself.
I also agree with everything else you said.
I do a small bit of this in the coproduct
embed
PR, but I think there should be more:There should be one central piece of documentation (which other methods can link to) describing the
Index
technique commonly used in frunk, describing how:Index
type parameters. Even when using turbofish syntax (once available), these should generally be left to type inference using_
.pluck
and coproduct'sinject
succeed when the type appears exactly once in the HList/coproduct.It should also explain workarounds for when type inference fails:
funky
)