There are two different overloads of Tuple.Create
:
Tuple.Create<'T1>(item1: 'T1)
Tuple.Create<'T1, 'T2>(item1: 'T1, item2: 'T2)
In the first case you just calling a method with two arguments. So the second Tuple.Create
overload is obviously picked. No surprise.
But with piping you first create a tuple instance. And then pass it to Tuple.Create
method. This is what happens in the second example
let intermediate : Tuple<int, string> = (10, "foo")
let tuple = Tuple.Create(intermediate)
With a single argument the first Tuple.Create
overload will be picked.
Note: star type is a way tuple type names are written in F#. So Tuple<int, string, bool>
will be (int * string * bool)
. It's the same thing.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…