Agda-2.6.0.1: A dependently typed functional programming language and proof assistant

Safe Haskell | Safe
Language | Haskell2010

Agda.Utils.VarSet

Description

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

Synopsis

- type VarSet = IntSet
- union :: IntSet -> IntSet -> IntSet
- unions :: Foldable f => f 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

type VarSet = IntSet Source #

union :: IntSet -> IntSet -> IntSet Source #

O(n+m). The union of two sets.

unions :: Foldable f => f IntSet -> IntSet Source #

The union of a list of sets.

member :: Key -> IntSet -> Bool Source #

O(min(n,W)). Is the value a member of the set?

empty :: IntSet Source #

O(1). The empty set.

delete :: Key -> IntSet -> IntSet Source #

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

singleton :: Key -> IntSet Source #

O(1). A set of one element.

fromList :: [Key] -> IntSet Source #

O(n*min(n,W)). Create a set from a list of integers.

toList :: IntSet -> [Key] Source #

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

toDescList :: IntSet -> [Key] Source #

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

isSubsetOf :: IntSet -> IntSet -> Bool Source #

O(n+m). Is this a subset? `(s1 `isSubsetOf` s2)` tells whether `s1` is a subset of `s2`.

null :: IntSet -> Bool Source #

O(1). Is the set empty?

intersection :: IntSet -> IntSet -> IntSet Source #

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

difference :: IntSet -> IntSet -> IntSet Source #

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

subtract :: Int -> VarSet -> VarSet Source #