graphql-engine-1.0.0: GraphQL API over Postgres
Safe HaskellNone
LanguageHaskell2010

Data.HashMap.Strict.Multi

Description

HashMap to multiple values.

Synopsis

Documentation

newtype MultiMap k v Source #

Map from keys to sets of values

Constructors

MultiMap 

Fields

Instances

Instances details
(Eq k, Eq v) => Eq (MultiMap k v) Source # 
Instance details

Defined in Data.HashMap.Strict.Multi

Methods

(==) :: MultiMap k v -> MultiMap k v -> Bool #

(/=) :: MultiMap k v -> MultiMap k v -> Bool #

(Show k, Show v) => Show (MultiMap k v) Source # 
Instance details

Defined in Data.HashMap.Strict.Multi

Methods

showsPrec :: Int -> MultiMap k v -> ShowS #

show :: MultiMap k v -> String #

showList :: [MultiMap k v] -> ShowS #

(Eq k, Hashable k, Ord v) => Semigroup (MultiMap k v) Source # 
Instance details

Defined in Data.HashMap.Strict.Multi

Methods

(<>) :: MultiMap k v -> MultiMap k v -> MultiMap k v #

sconcat :: NonEmpty (MultiMap k v) -> MultiMap k v #

stimes :: Integral b => b -> MultiMap k v -> MultiMap k v #

(Eq k, Hashable k, Ord v) => Monoid (MultiMap k v) Source # 
Instance details

Defined in Data.HashMap.Strict.Multi

Methods

mempty :: MultiMap k v #

mappend :: MultiMap k v -> MultiMap k v -> MultiMap k v #

mconcat :: [MultiMap k v] -> MultiMap k v #

(ToJSON v, ToJSONKey k) => ToJSON (MultiMap k v) Source # 
Instance details

Defined in Data.HashMap.Strict.Multi

Methods

toJSON :: MultiMap k v -> Value

toEncoding :: MultiMap k v -> Encoding

toJSONList :: [MultiMap k v] -> Value

toEncodingList :: [MultiMap k v] -> Encoding

singleton :: Hashable k => k -> v -> MultiMap k v Source #

Construct a MmultiMap with a single key, to which only one value is associated.

fromMap :: HashMap k (Set v) -> MultiMap k v Source #

Construct a MultiMap with the supplied mappings.

toMap :: MultiMap k v -> HashMap k (Set v) Source #

Convert a MultiMap to a HashMap.

fromList :: (Eq k, Hashable k, Ord v) => [(k, v)] -> MultiMap k v Source #

Creates a MultiMap from an association list.

If the provided list constains duplicate mappings, the resulting MultiMap will store the set of all mapped values for each duplicate key.

toList :: MultiMap k v -> [(k, [v])] Source #

Creates an association list from a MultiMap.

Each set of values associated with a given key is transformed back into a list.

lookup :: (Eq k, Hashable k) => k -> MultiMap k v -> Set v Source #

Return the value to which the specified key is mapped, or Nothing if this map contains no mapping for the key.

insert :: (Eq k, Hashable k, Ord v) => k -> v -> MultiMap k v -> MultiMap k v Source #

Associate the specified value with the specified key in this map.

If this map previously contained a mapping for the key, the new value is inserted in the set, and does not replace the previous mapping.

keys :: MultiMap k v -> [k] Source #

Returns a list of this map's keys.

elems :: MultiMap k v -> [Set v] Source #

Returns a list of this map's set of values.