ghc-8.0.2: The GHC API

Safe Haskell | None
Language | Haskell2010

UniqDSet

Contents

- Unique set type
  - Manipulating these sets

Description

Specialised deterministic sets, for things with `Uniques`

Based on `UniqDFMs` (as you would expect). See Note [Deterministic UniqFM] in UniqDFM for explanation why we need it.

Basically, the things need to be in class `Uniquable`.

Synopsis

- type UniqDSet a = UniqDFM a
- delOneFromUniqDSet :: Uniquable a => UniqDSet a -> a -> UniqDSet a
- delListFromUniqDSet :: Uniquable a => UniqDSet a -> [a] -> UniqDSet a
- emptyUniqDSet :: UniqDSet a
- unitUniqDSet :: Uniquable a => a -> UniqDSet a
- mkUniqDSet :: Uniquable a => [a] -> UniqDSet a
- addOneToUniqDSet :: Uniquable a => UniqDSet a -> a -> UniqDSet a
- addListToUniqDSet :: Uniquable a => UniqDSet a -> [a] -> UniqDSet a
- unionUniqDSets :: UniqDSet a -> UniqDSet a -> UniqDSet a
- unionManyUniqDSets :: [UniqDSet a] -> UniqDSet a
- minusUniqDSet :: UniqDSet a -> UniqDSet a -> UniqDSet a
- uniqDSetMinusUniqSet :: UniqDSet a -> UniqSet a -> UniqDSet a
- intersectUniqDSets :: UniqDSet a -> UniqDSet a -> UniqDSet a
- intersectsUniqDSets :: UniqDSet a -> UniqDSet a -> Bool
- foldUniqDSet :: (a -> b -> b) -> b -> UniqDSet a -> b
- elementOfUniqDSet :: Uniquable a => a -> UniqDSet a -> Bool
- filterUniqDSet :: (a -> Bool) -> UniqDSet a -> UniqDSet a
- sizeUniqDSet :: UniqDSet a -> Int
- isEmptyUniqDSet :: UniqDSet a -> Bool
- lookupUniqDSet :: Uniquable a => UniqDSet a -> a -> Maybe a
- uniqDSetToList :: UniqDSet a -> [a]
- partitionUniqDSet :: (a -> Bool) -> UniqDSet a -> (UniqDSet a, UniqDSet a)

# Unique set type

type UniqDSet a = UniqDFM a Source #

## Manipulating these sets

delOneFromUniqDSet :: Uniquable a => UniqDSet a -> a -> UniqDSet a Source #

delListFromUniqDSet :: Uniquable a => UniqDSet a -> [a] -> UniqDSet a Source #

emptyUniqDSet :: UniqDSet a Source #

unitUniqDSet :: Uniquable a => a -> UniqDSet a Source #

mkUniqDSet :: Uniquable a => [a] -> UniqDSet a Source #

addOneToUniqDSet :: Uniquable a => UniqDSet a -> a -> UniqDSet a Source #

addListToUniqDSet :: Uniquable a => UniqDSet a -> [a] -> UniqDSet a Source #

unionUniqDSets :: UniqDSet a -> UniqDSet a -> UniqDSet a Source #

unionManyUniqDSets :: [UniqDSet a] -> UniqDSet a Source #

minusUniqDSet :: UniqDSet a -> UniqDSet a -> UniqDSet a Source #

uniqDSetMinusUniqSet :: UniqDSet a -> UniqSet a -> UniqDSet a Source #

intersectUniqDSets :: UniqDSet a -> UniqDSet a -> UniqDSet a Source #

intersectsUniqDSets :: UniqDSet a -> UniqDSet a -> Bool Source #

foldUniqDSet :: (a -> b -> b) -> b -> UniqDSet a -> b Source #

elementOfUniqDSet :: Uniquable a => a -> UniqDSet a -> Bool Source #

filterUniqDSet :: (a -> Bool) -> UniqDSet a -> UniqDSet a Source #

sizeUniqDSet :: UniqDSet a -> Int Source #

isEmptyUniqDSet :: UniqDSet a -> Bool Source #

lookupUniqDSet :: Uniquable a => UniqDSet a -> a -> Maybe a Source #

uniqDSetToList :: UniqDSet a -> [a] Source #

partitionUniqDSet :: (a -> Bool) -> UniqDSet a -> (UniqDSet a, UniqDSet a) Source #