That is, I\'d like to have a tuple of values.
The use case on my mind:
Dictionary, object>
or
<
I have implemented a tuple library in C#. Visit http://www.adventuresinsoftware.com/generics/ and click on the "tuples" link.
public struct Pair<T1, T2>
{
public T1 First;
public T2 Second;
}
public struct Triple<T1, T2, T3>
{
public T1 First;
public T2 Second;
public T3 Third;
}
There are also the Tuple<> types in F#; you just need to reference FSharp.Core.dll.
NGenerics - the popular .Net algorithms and data structures library, has recently introduced immutable data structures to the set.
The first immutable ones to implement were pair and tuple classes. The code is well covered with tests and is quite elegant. You can check it here. They are working on the other immutable alternatives at the moment and they should be ready shortly.