A set of values. A set cannot contain duplicate values.
Instances18Foldable, Eq1, Ord1, Show1, NFData1, Hashable1, …
Foldable HashSetDefined in unordered-containers-0.2.21 · Data.HashSet.InternalEq1 HashSetDefined in unordered-containers-0.2.21 · Data.HashSet.InternalOrd1 HashSetDefined in unordered-containers-0.2.21 · Data.HashSet.InternalShow1 HashSetDefined in unordered-containers-0.2.21 · Data.HashSet.InternalNFData1 HashSetDefined in unordered-containers-0.2.21 · Data.HashSet.InternalHashable1 HashSetDefined in unordered-containers-0.2.21 · Data.HashSet.InternalLift a => Lift (HashSet a)Defined in unordered-containers-0.2.21 · Data.HashSet.InternalHashable a => IsList (HashSet a)Defined in unordered-containers-0.2.21 · Data.HashSet.InternalEq a => Eq (HashSet a)Defined in unordered-containers-0.2.21 · Data.HashSet.InternalNote that, in the presence of hash collisions, equal
HashSets may behave differently, i.e. extensionality may be violated:Example2 expressions data D = A | B deriving (Eq, Show)instance Hashable D where hashWithSalt salt _d = salt
Example2 expressions x = fromList [A, B]y = fromList [B, A]
Example3 expressions x == yTruetoList x[A,B]toList y[B,A]
In general, the lack of extensionality can be observed with any function that depends on the key ordering, such as folds and traversals.
(Data a, Hashable a) => Data (HashSet a)Defined in unordered-containers-0.2.21 · Data.HashSet.InternalOrd a => Ord (HashSet a)Defined in unordered-containers-0.2.21 · Data.HashSet.Internal(Hashable a, Read a) => Read (HashSet a)Defined in unordered-containers-0.2.21 · Data.HashSet.InternalShow a => Show (HashSet a)Defined in unordered-containers-0.2.21 · Data.HashSet.InternalHashable a => Semigroup (HashSet a)Defined in unordered-containers-0.2.21 · Data.HashSet.InternalHashable a => Monoid (HashSet a)Defined in unordered-containers-0.2.21 · Data.HashSet.InternalNFData a => NFData (HashSet a)Defined in unordered-containers-0.2.21 · Data.HashSet.InternalHashable a => Hashable (HashSet a)Defined in unordered-containers-0.2.21 · Data.HashSet.Internaltype Item (HashSet a) = aDefined in unordered-containers-0.2.21 · Data.HashSet.Internal