Module
Data.Set
- Package
- purescript-ordered-collections
- Repository
- purescript/purescript-ordered-collections
This module defines a type of sets as height-balanced (AVL) binary trees. Efficient set operations are implemented in terms of https://www.cs.cmu.edu/~guyb/papers/BFS16.pdf
#fromFoldable Source
fromFoldable :: forall f a. Foldable f => Ord a => f a -> Set a
Create a set from a foldable structure.
#toUnfoldable Source
toUnfoldable :: forall f a. Unfoldable f => Set a -> f a
Convert a set to an unfoldable structure.
#checkValid Source
checkValid :: forall a. Ord a => Set a -> Boolean
Check whether the underlying tree satisfies the height, size, and ordering invariants.
This function is provided for internal use.
#properSubset Source
properSubset :: forall a. Ord a => Set a -> Set a -> Boolean
True if and only if the first set is a subset of the second set and the sets are not equal
#intersection Source
intersection :: forall a. Ord a => Set a -> Set a -> Set a
The set of elements which are in both the first and second set