What’s the purpose of the Tuple(T1)/Singleton in .net?

You’d have to ask the BCL designers to be certain, but I suspect that since there is a 1-tuples in the real world, the .NET framework authors wanted to provide equivalent symmetry in their implementation.

Tuples are the .NET implementation of what you’d consider the mathematical concept of a tuple.

Now since you’re asking for programming uses for Tuple<T>, I would also answer that there are .NET languages (like F#) that could use Tuple<> for representation of things like return values from functions. Since an F# function could certainly return a 1-tuple as a result – it adds symmetry and consistency to the behavior and feel of the language.

Your example with 8+ tuples is also probably legitimate, in that the Rest property could be a 1-tuple to represent the “overflow”.

Leave a Comment