Safe Haskell | Safe-Infered |
---|
Var field implementation of sets of (small) natural numbers.
- type VarSet = Set Integer
- union :: Ord a => Set a -> Set a -> Set a
- unions :: Ord a => [Set a] -> Set a
- member :: Ord a => a -> Set a -> Bool
- empty :: Set a
- delete :: Ord a => a -> Set a -> Set a
- singleton :: a -> Set a
- fromList :: Ord a => [a] -> Set a
- toList :: Set a -> [a]
- isSubsetOf :: Ord a => Set a -> Set a -> Bool
- subtract :: Integer -> VarSet -> VarSet
Documentation
union :: Ord a => Set a -> Set a -> Set a
O(n+m). The union of two sets, preferring the first set when
equal elements are encountered.
The implementation uses the efficient hedge-union algorithm.
Hedge-union is more efficient on (bigset union
smallset).
isSubsetOf :: Ord a => Set a -> Set a -> Bool
O(n+m). Is this a subset?
(s1
tells whether isSubsetOf
s2)s1
is a subset of s2
.