I noticed a quite weird behavior of the System.Tuple.Create method in F#. When looking at the MSDN documentation it indicates that the return type is of System.Tuple<T>. However when using this method in F# all overloads except Tuple.Create(T) will return 'T1 * 'T2. Obviously invoking the Tuple<T> constructor will return Tuple<T>. But I don't understand how the return type of the Tuple.Create is different in F#.
Tuple.Create in F#
559 Views Asked by Overly Excessive At
1
There are 1 best solutions below
Related Questions in .NET
- file download method in visual studio 2017
- Repository manager receives the wrong connection string in .net core
- MongoDb not connecting C#
- The current .NET SDK does not support targeting .NET Core 6.0. Brand new WPF Project VS Community 2022 17.9.5
- Why Scanning GSI on DynamoDb doesnt work as fast as expected when using CONTAINS?
- Are "blittable types" really unmanaged types for StructLayout Sequential
- Failed to fetch dynamically imported module on Blazor JS Interop
- Problem to upload several images per one request
- Implementing Azure AD B2C Authentication in .NET 8 Blazor Project (RenderMode: InteractiveAuto)
- Stripe connect payout - throws exceptions
- 'IOException: The cloud file provider is not running', when trying to delete 'cloud' folder
- Azure Application Insights Not Displaying Custom Logs for Azure Functions with .NET 8
- Convert C# DateTime.Ticks to Bigquery DateTime Format
- Socket.io nodejs server .NET connection
- Producer Batching Service Bus Vs Kafka
Related Questions in F#
Related Questions in TUPLES
- How can py tuple implicit cast to int?
- How to do a Tuple extension in current Swift? It seems to be available experimentally
- cannot reshape array of size 4 into shape (4,4) in DataFrame where clause
- Nextflow filter entire tuple based on one value
- Using a list of tuple and a relative item of a Tuple as an argument of a method
- How do i swap my keys and values without it reading letter for letter?
- == and Equals for Tuple<object>
- Pygame - Collision of 3 graphics: AttributeError: 'tuple' object has no attribute 'collidepoint'
- Appending tuples returned by for loop
- making a std::tuple from the result of a pack
- Is there a way in c# to deconstruct a tuple and pass the values in one line?
- How to compare two tuple list, return the highest value and the variable name from which the highest value is found?
- Why is the tuple index out of range in the generation of timeseries with tigramite library?
- DMS conversion method not accepting input without seconds component
- Longitude sign incorrect in GeoCoordinates output
Related Questions in BASE-CLASS-LIBRARY
- How i can add endpoint (or сatch a request and check its path) to BCL?
- Possible to add an element to a .NET Dictionary skipping the internal ContainsKey() call
- Blazor Component Library as nuget Package does not provide css files
- Where to find Microsoft .NET (C#) BCL reference, what classes are available in BCL packages?
- How to call a method from another C# library project in Visual Studio?
- Under what circumstances _buckets[bucketNumber].key == _buckets && ((_buckets[bucketNumber].hash_coll & unchecked(0x80000000)) == 0)) in Hashtable
- Does Every .NET Language have their own built in library or they follows BCL (Framework Base Class Library) of .NET framework?
- Microsoft.Bcl.AsyncInterfaces error (in CSVHelper method) when running the application installed by Visual Studio Setup project
- C# create a synonymous type for System.Single with a subset of features
- What is the GetFullPath(String, String) overload?
- How do I print in .NET-based non-GUI applications?
- MSBuild fail to build web site with reference a Bcl related library
- DevOps CI pipe is failing claiming Microsoft.Bcl.Build
- WPF coded UI test randomly fails with weird ArgumentException
- Relationship between Base Class Library and .NET Standard
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
The tuple type of F# (a syntactic tuple) is compiled as
System.Tuple<..>. So they are the same type at .NET level but for F# type system they are different types: the type of a syntactic tuple will not match the type of aSystem.Tuple<..>but their runtime type will be the same.You can find a detailed description in the F# spec
The example with
new System.Tuple<'t>()does not return a syntactic tuple, probably because you are instantiating explicitly a specific type and you should get back exactly that.Here are some tests:
So, at compile time they are different but at runtime they are the same. That's why when you use
.GetType()you get the same result.