Safe Haskell | Safe |
---|---|

Language | Haskell98 |

Var field implementation of sets of (small) natural numbers.

- type VarSet = IntSet
- union :: IntSet -> IntSet -> IntSet
- unions :: [IntSet] -> IntSet
- member :: Key -> IntSet -> Bool
- empty :: IntSet
- delete :: Key -> IntSet -> IntSet
- singleton :: Key -> IntSet
- fromList :: [Key] -> IntSet
- toList :: IntSet -> [Key]
- toDescList :: IntSet -> [Key]
- isSubsetOf :: IntSet -> IntSet -> Bool
- null :: IntSet -> Bool
- intersection :: IntSet -> IntSet -> IntSet
- difference :: IntSet -> IntSet -> IntSet
- subtract :: Int -> VarSet -> VarSet

# Documentation

delete :: Key -> IntSet -> IntSet #

*O(min(n,W))*. Delete a value in the set. Returns the
original set when the value was not present.

toDescList :: IntSet -> [Key] #

*O(n)*. Convert the set to a descending list of elements. Subject to list
fusion.

isSubsetOf :: IntSet -> IntSet -> Bool #

*O(n+m)*. Is this a subset?
`(s1 `

tells whether `isSubsetOf`

s2)`s1`

is a subset of `s2`

.

intersection :: IntSet -> IntSet -> IntSet #

*O(n+m)*. The intersection of two sets.

difference :: IntSet -> IntSet -> IntSet #

*O(n+m)*. Difference between two sets.