clash-lib-1.7.0: Clash: a functional hardware description language - As a library
Safe HaskellNone
LanguageHaskell2010

Clash.Data.UniqMap

Synopsis

Documentation

newtype UniqMap a Source #

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.

Constructors

UniqMap 

Fields

Instances

Instances details
Functor UniqMap Source # 
Instance details

Defined in Clash.Data.UniqMap

Methods

fmap :: (a -> b) -> UniqMap a -> UniqMap b #

(<$) :: a -> UniqMap b -> UniqMap a #

Foldable UniqMap Source # 
Instance details

Defined in Clash.Data.UniqMap

Methods

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 #

toList :: UniqMap a -> [a] #

null :: UniqMap a -> Bool #

length :: UniqMap a -> Int #

elem :: Eq a => a -> UniqMap a -> Bool #

maximum :: Ord a => UniqMap a -> a #

minimum :: Ord a => UniqMap a -> a #

sum :: Num a => UniqMap a -> a #

product :: Num a => UniqMap a -> a #

Traversable UniqMap Source # 
Instance details

Defined in Clash.Data.UniqMap

Methods

traverse :: Applicative f => (a -> f b) -> UniqMap a -> f (UniqMap b) #

sequenceA :: Applicative f => UniqMap (f a) -> f (UniqMap a) #

mapM :: Monad m => (a -> m b) -> UniqMap a -> m (UniqMap b) #

sequence :: Monad m => UniqMap (m a) -> m (UniqMap a) #

Show a => Show (UniqMap a) Source # 
Instance details

Defined in Clash.Data.UniqMap

Methods

showsPrec :: Int -> UniqMap a -> ShowS #

show :: UniqMap a -> String #

showList :: [UniqMap a] -> ShowS #

Semigroup (UniqMap a) Source # 
Instance details

Defined in Clash.Data.UniqMap

Methods

(<>) :: UniqMap a -> UniqMap a -> UniqMap a #

sconcat :: NonEmpty (UniqMap a) -> UniqMap a #

stimes :: Integral b => b -> UniqMap a -> UniqMap a #

Monoid (UniqMap a) Source # 
Instance details

Defined in Clash.Data.UniqMap

Methods

mempty :: UniqMap a #

mappend :: UniqMap a -> UniqMap a -> UniqMap a #

mconcat :: [UniqMap a] -> UniqMap a #

Binary a => Binary (UniqMap a) Source # 
Instance details

Defined in Clash.Data.UniqMap

Methods

put :: UniqMap a -> Put #

get :: Get (UniqMap a) #

putList :: [UniqMap a] -> Put #

NFData a => NFData (UniqMap a) Source # 
Instance details

Defined in Clash.Data.UniqMap

Methods

rnf :: UniqMap a -> () #

ClashPretty a => ClashPretty (UniqMap a) Source # 
Instance details

Defined in Clash.Data.UniqMap

Methods

clashPretty :: UniqMap a -> Doc () Source #

empty :: UniqMap a Source #

An empty map.

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.

null :: UniqMap a -> Bool Source #

Check if the map is empty.

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.

submap :: UniqMap b -> UniqMap b -> Bool Source #

Check if one map is a submap of another.

fromList :: Uniquable a => [(a, b)] -> UniqMap b Source #

Convert a list of key-value pairs to a map.

toList :: UniqMap b -> [(Unique, b)] Source #

Convert a map to a list of unique-value pairs.

keys :: UniqMap b -> [Unique] Source #

Get the unique keys of a map.

elems :: UniqMap b -> [b] Source #

Get the values of a map.