richbryant/BetterUnit

Implicit conversion to ValueTuple

Closed this issue · 2 comments

Not sure if you've seen this in the language-ext implementation, but I think this would have future value (if the Roslyn team ever make the empty tuple () valid).

    public static implicit operator ValueTuple(Unit _) => 
        default;
        
    public static implicit operator Unit(ValueTuple _) => 
        default;

It should certainly be included. The idea of this implementation was to cover all three of the major libraries so apart from anything else, I can't leave it out or it'd make a breaking change.

And yes, we can hope for eventual BCL support there.

That's done, I'll close this one now.