❔ Generics with different input and output type
I'm writing a generic at the moment which it something like this:
When I'm calling it, is there any way to only specify
Ideally I'd like to be able to type something like:
rather than
Is something like this possible at all?
When I'm calling it, is there any way to only specify
T without specifying U (as this can be inferred from the argument being passed in).Ideally I'd like to be able to type something like:
rather than
Is something like this possible at all?