F# records vs .net struct

后端 未结 4 2019
忘了有多久
忘了有多久 2021-02-05 18:52

is f# records is the same as .net struct? I saw people talk about f# struct,are they use this term interchangable with F# records? Like in FSharp runs my algorithm slower than P

4条回答
  •  南方客
    南方客 (楼主)
    2021-02-05 19:25

    Stephen Swensen is correct, I'd like to add one important detail, Record Types support structural equality, as do .NET’s value type, so there equality tests have the similar behavior (there may be subtle differences if a record contains something that can’t be compared using structural equality).

提交回复
热议问题