Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- newtype UniqMap a = UniqMap {
- uniqMapToIntMap :: IntMap a
- empty :: UniqMap a
- singleton :: Uniquable a => a -> b -> UniqMap b
- singletonUnique :: Uniquable a => a -> UniqMap a
- null :: UniqMap a -> Bool
- insert :: Uniquable a => a -> b -> UniqMap b -> UniqMap b
- insertUnique :: Uniquable a => a -> UniqMap a -> UniqMap a
- insertWith :: Uniquable a => (b -> b -> b) -> a -> b -> UniqMap b -> UniqMap b
- insertMany :: Uniquable a => [(a, b)] -> UniqMap b -> UniqMap b
- lookup :: Uniquable a => a -> UniqMap b -> Maybe b
- find :: Uniquable a => a -> UniqMap b -> b
- elem :: Uniquable a => a -> UniqMap b -> Bool
- notElem :: Uniquable a => a -> UniqMap b -> Bool
- filter :: (b -> Bool) -> UniqMap b -> UniqMap b
- mapMaybe :: (a -> Maybe b) -> UniqMap a -> UniqMap b
- foldrWithUnique :: (Unique -> a -> b -> b) -> b -> UniqMap a -> b
- foldlWithUnique' :: (b -> Unique -> a -> b) -> b -> UniqMap a -> b
- delete :: Uniquable a => a -> UniqMap b -> UniqMap b
- deleteMany :: Uniquable a => [a] -> UniqMap b -> UniqMap b
- unionWith :: (b -> b -> b) -> UniqMap b -> UniqMap b -> UniqMap b
- difference :: UniqMap b -> UniqMap b -> UniqMap b
- disjoint :: UniqMap b -> UniqMap b -> Bool
- submap :: UniqMap b -> UniqMap b -> Bool
- fromList :: Uniquable a => [(a, b)] -> UniqMap b
- toList :: UniqMap b -> [(Unique, b)]
- keys :: UniqMap b -> [Unique]
- elems :: UniqMap b -> [b]
Documentation
A map indexed by a Unique
. Typically the elements of this map are also
uniqueable and provide their own key, however a unique can be associated
with any value.
UniqMap | |
|
Instances
Functor UniqMap Source # | |
Foldable UniqMap Source # | |
Defined in Clash.Data.UniqMap fold :: Monoid m => UniqMap m -> m # foldMap :: Monoid m => (a -> m) -> UniqMap a -> m # foldMap' :: Monoid m => (a -> m) -> UniqMap a -> m # foldr :: (a -> b -> b) -> b -> UniqMap a -> b # foldr' :: (a -> b -> b) -> b -> UniqMap a -> b # foldl :: (b -> a -> b) -> b -> UniqMap a -> b # foldl' :: (b -> a -> b) -> b -> UniqMap a -> b # foldr1 :: (a -> a -> a) -> UniqMap a -> a # foldl1 :: (a -> a -> a) -> UniqMap a -> a # elem :: Eq a => a -> UniqMap a -> Bool # maximum :: Ord a => UniqMap a -> a # minimum :: Ord a => UniqMap a -> a # | |
Traversable UniqMap Source # | |
Show a => Show (UniqMap a) Source # | |
Semigroup (UniqMap a) Source # | |
Monoid (UniqMap a) Source # | |
Binary a => Binary (UniqMap a) Source # | |
NFData a => NFData (UniqMap a) Source # | |
Defined in Clash.Data.UniqMap | |
ClashPretty a => ClashPretty (UniqMap a) Source # | |
Defined in Clash.Data.UniqMap clashPretty :: UniqMap a -> Doc () Source # |
singleton :: Uniquable a => a -> b -> UniqMap b Source #
A map containing a single value indexed by the given key's unique.
singletonUnique :: Uniquable a => a -> UniqMap a Source #
A map containing a single value indexed by the value's unique.
insert :: Uniquable a => a -> b -> UniqMap b -> UniqMap b Source #
Insert a new key-value pair into the map.
insertUnique :: Uniquable a => a -> UniqMap a -> UniqMap a Source #
Insert a new value into the map, using the unique of the value as the key.
insertWith :: Uniquable a => (b -> b -> b) -> a -> b -> UniqMap b -> UniqMap b Source #
Insert a new key-value pair into the map, using the given combining function if there is already an entry with the same unique in the map.
insertMany :: Uniquable a => [(a, b)] -> UniqMap b -> UniqMap b Source #
Insert a list of key-value pairs into the map.
lookup :: Uniquable a => a -> UniqMap b -> Maybe b Source #
Lookup an item in the map, using the unique of the given key.
find :: Uniquable a => a -> UniqMap b -> b Source #
Lookup and item in the map, using the unique of the given key. If the item is not found in the map an error is raised.
elem :: Uniquable a => a -> UniqMap b -> Bool Source #
Check if there is an entry in the map for the unique of the given value.
notElem :: Uniquable a => a -> UniqMap b -> Bool Source #
Check if there is not an entry in the map for the unique of the given value.
filter :: (b -> Bool) -> UniqMap b -> UniqMap b Source #
Filter all elements in the map according to some predicate.
mapMaybe :: (a -> Maybe b) -> UniqMap a -> UniqMap b Source #
Apply a function to all elements in the map, keeping those where the
result is not Nothing
.
foldrWithUnique :: (Unique -> a -> b -> b) -> b -> UniqMap a -> b Source #
Lazily right-fold over the map using the given function.
foldlWithUnique' :: (b -> Unique -> a -> b) -> b -> UniqMap a -> b Source #
Strictly left-fold over the map using the given function.
delete :: Uniquable a => a -> UniqMap b -> UniqMap b Source #
Delete the entry in the map indexed by the unique of the given value.
deleteMany :: Uniquable a => [a] -> UniqMap b -> UniqMap b Source #
Delete all entries in the map indexed by the uniques of the given values.
unionWith :: (b -> b -> b) -> UniqMap b -> UniqMap b -> UniqMap b Source #
Merge two unique maps, using the given combining funcion if a value with the same unique key exists in both maps.
difference :: UniqMap b -> UniqMap b -> UniqMap b Source #
Filter the first map to only contain keys which are not in the second map.
disjoint :: UniqMap b -> UniqMap b -> Bool Source #
Check if there are no common keys between two maps.