Wednesday, August 30, 2017

System.ValueTuple; we are not there yet

The introduction of System.ValueTuple makes using Tuples in .NET a lot more user friendly and fixes the mistake of making System.Tuple<> a reference type.

Creating a tuple becomes this easy:

Still there are some rough edges, for example what do you think will happen if I try to execute the following code:

Turns out that the ValueTuple has no built in support for equality checks:

image

In F# this works without a problem:

image

No comments: