That requires making a 1-to-1 relationship between each `Smashable`-adopter and each `Value`-adopter
Conversation
1
Does that permit Brent’s use case, where it accepts one Value but returns a different one?
2
1
I’m looking at your original one. How can valueBySmashing… take a Foo and return a Bar?
2
It couldn’t without the <T, U> formulation from my comment. Didn’t see that he needed that. Updated.
1
This doesn't work — but I'm not sure why it doesn't work.
2
in this, U is determined by the caller and can be anything. But impl always returns Bar.
2
Yep. Okay. No way to fix this without making Value hetero-equatable, as said. :(
3
What if Value was an enum with associated values, not protocol?
2
Replying to




