Therefore, I am trying to use F # Set as a hash table. But my element type does not implement the IComparable interface (although it implements IEquatable ). I received a message stating that the design is not allowed due to limitation of comparison. And after some further reading, I found that the F # Set is implemented using a binary tree, which makes O(log(n)) reason for the insertion. This looks strange to me, why is the Set structure designed this way?
Edit: So, I found out that Set in F # is actually a SortedSet . And I think the question arises, why is the Sorted Set somehow preferable to a common set of hashes as an immutable / functional data structure?
source share