-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HList with trait bounded items #207
Comments
Could you clarify a bit more what you're trying to do? |
I want to construct a hlist of tokens, all satisfying certain trait called |
Does this do what you want? impl<Head, Tail> AdjectiveToken for HCons<Head, Tail>
where
Head: AdjectiveToken,
Tail: AdjectiveToken,
{ ... }
impl AdjectiveToken for HNil { ... }
fn function_which_needs_all_hlist_elements_to_be_tokens<Head, Tail>(hlist: HCons<Head, Tail>)
where
HCons<Head, Tail>: AdjectiveToken
{ ... } |
I assume, you meant following: trait AdjectiveTokenList {}
impl<Head, Tail> AdjectiveTokenList for HCons<Head, Tail>
where
Head: AdjectiveToken,
Tail: AdjectiveTokenList,
{ ... }
impl AdjectiveTokenList for HNil { ... }
fn function_which_needs_all_hlist_elements_to_be_tokens<Head, Tail>(hlist: HCons<Head, Tail>)
where
HCons<Head, Tail>: AdjectiveTokenList
{...} If so, indeed that is what i mean. But issue is, such an |
Please sketch out the pseudocode of what you're hoping to do in the end, I'm really having a hard time understanding. |
Thanks for frunk!
Sorry if this is obvious, but i cannot figure out how to spell out an hlist with all items satisfying a trait bound. Could you help?
Thanks again for your work.
The text was updated successfully, but these errors were encountered: