Conversation
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
Depends if ‘Values’ must be easily extended with new types/cases?
1
Replying to
Yeah, expression problem and all that…
Replying to
An option worth considering then; should it fit with the problem.




