Why does not F# provide a custom overload for operator==?

Discriminated unions and other primitive types in F# uses structural equality by default, and provides a generated override for the .Equals method. The F# equality operator apparently differs from the C# one in that it uses the .Equals method even for reference types, but when F# discriminated unions are used from C#, the default operator== for object is used, which checks for reference equality rather than structural equality.

Why does not F# generate a custom operator== for discriminated union types so that == gives the expected behaviour when used in other .NET languages?

7
задан SoftMemes 23 September 2010 в 11:44
поделиться