F# -> Implement IComparable for HashSet<'a>

后端 未结 2 900
醉梦人生
醉梦人生 2021-01-19 17:59

Is it possible to somehow implement IComparable for a HashSet<\'a>? The reason for this is that I have following record declared:

<         


        
2条回答
  •  后悔当初
    2021-01-19 18:58

    See

    https://docs.microsoft.com/en-gb/archive/blogs/dsyme/equality-and-comparison-constraints-in-f

    Briefly, I think you want to apply the CustomEquality and CustomComparison attributes to this type and then implement it yourself.

提交回复
热议问题