Copyright | (c) David Janssen 2019 |
---|---|
License | MIT |
Maintainer | janssen.dhj@gmail.com |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
This datastructure represents a `k -> Set v` mapping: that is to say, each key can have multiple values (but no duplicates). Additionally, we provide some operations to reverse this mapping.
In KMonad we use this exclusively to easily define multiple names for the same
Keycode
in a reversible manner.
Types
The MultiMap
, which describes a one to many (unique) mapping
Instances
(Show k, Show v) => Show (MultiMap k v) Source # | |
CanMM k v => Semigroup (MultiMap k v) Source # | |
CanMM k v => Monoid (MultiMap k v) Source # | |
CanMM k v => Ixed (MultiMap k v) Source # | |
Defined in Data.MultiMap | |
CanMM k v => At (MultiMap k v) Source # | |
type Index (MultiMap k v) Source # | |
Defined in Data.MultiMap | |
type IxValue (MultiMap k v) Source # | |
Defined in Data.MultiMap |
mkMultiMap :: (Foldable t1, Foldable t2, CanMM k v) => t1 (k, t2 v) -> MultiMap k v Source #
Create a new multimap from a foldable of (k, foldable v) pairs.
fromSingletons :: (Foldable t, CanMM k v) => t (k, v) -> MultiMap k v Source #
Create a new multimap from a foldable of (k, v) pairs