Closed ExpHP closed 6 years ago
Root-level reexports, since it appears to me that the traits are intended to possibly be implemented by users on their own types. (@Centril: please verify?)
These are mostly to facilitate quick construction of HLists from smaller parts, they are the "inject" equivalents for HLists.
but I left them out because I am worried about collisions with From::from and Into::into.
Should we solve this by renaming the methods in Generic?
These are mostly to facilitate quick construction of HLists from smaller parts, they are the "inject" equivalents for HLists.
Okay. In that case the prelude sounds like a better fit for them. (I'll keep the lift_from
function reexported)
Should we solve this by renaming the methods in Generic?
Sounds good to me. (also renaming the ones in LabelledGeneric to avoid conflicts between the two)
That said, Generic
and LabelledGeneric
they don't need to go in the prelude right now because there's a bunch of reexported free functions (which is what I mostly changed README.md to use)
FWIW, I'm 👍 on renaming the methods on Generic and LabelledGeneric; that was a terrible decision that still haunts me.
Let the bikeshed commence!
So I was thinking about this today (in part because I'd like to move on with this and get on to adding other, more exciting features!). I think I would rather leave Generic
and LabelledGeneric
as is for now, as the free functions feel "good enough" to me.
I think the docs should not advertise the use of UFCS for these methods.
Aside: I am also thinking of removing the re-export of h_cons
, in favor of encouraging the use of hlist![head, ...tail]
.
Modulo that change, does this PR seem okay?
I think I would rather leave Generic and LabelledGeneric as is for now, as the free functions feel "good enough" to me.
OK; We can revisit later.
Aside: I am also thinking of removing the re-export of h_cons, in favor of encouraging the use of hlist![head, ...tail].
Agreed.
Modulo that change, does this PR seem okay?
I think so.
I'll make the aforementioned finishing touches and merge this on the weekend
This completes the paradigm shift from a focus on per-module glob imports to the more rust-y ideal of "
use
what you need." It adds aprelude
module to contain that small number of things that really should be glob-imported (i.e. things that the user might not realize they need :wink:).I grepped for everything that is
pub
in the repo and went down the list, considering where each thing belongs. I'll post a comment with reasoning for all of my choices.