-
Notifications
You must be signed in to change notification settings - Fork 66
Open
Labels
Description
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:
- Users should generally not worry about
Indextype parameters. Even when using turbofish syntax (once available), these should generally be left to type inference using_. - Generally speaking, type inference can solve for the indices whenever there is a unique solution.
- This means that methods like hlist's
pluckand coproduct'sinjectsucceed when the type appears exactly once in the HList/coproduct.
It should also explain workarounds for when type inference fails:
- The preferred method, whenever possible, should be to use newtypes in your HList/coproduct, so that all of the types are distinct. (@Centril, @lloydmeta do you agree?)
- As a last resort, indices can be specified explicitly, but I'm not sure that the docs should be suggesting this course of action quite yet as they feel mostly like an implementation detail. (maybe once reified indices are added, if I ever get to that; I still need to get more experience with them first in
funky)
Reactions are currently unavailable