I’m writing my code as if these are all the same thing, and having no problems, but it’s starting to confuse me when I hover over a function in Visual Studio and see that the type definitions contain 3 different types that I had thought were all the same. Are they the same? Or are they different?
Share
They are the same. See the type abbreviations at the bottom of the FSharp.Core documentation.
float = double = System.Doubleandarray<'T> = 'T[]. You can also define your own type abbreviations and use them the same way:You didn’t ask about it, but note that the one place where type abbreviations might not work quite like you’d expect is measure types;
float<_>is defined independently offloat,double, andSystem.Double, and there’s no such thing as a correspondingdouble<_>orSystem.Double<_>.