generative-art-0.1.0.0
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Multwomap

Synopsis

Documentation

data Multwomap k v Source #

A multimap where each key can have at most two entries. Note that this is an unsafe data structure: attempting to add a key twice will crash the program.

Instances

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

Defined in Data.Multwomap

Methods

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

show :: Multwomap k v -> String #

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

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

Defined in Data.Multwomap

Methods

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

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

(Ord k, Ord v) => Ord (Multwomap k v) Source # 
Instance details

Defined in Data.Multwomap

Methods

compare :: Multwomap k v -> Multwomap k v -> Ordering #

(<) :: Multwomap k v -> Multwomap k v -> Bool #

(<=) :: Multwomap k v -> Multwomap k v -> Bool #

(>) :: Multwomap k v -> Multwomap k v -> Bool #

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

max :: Multwomap k v -> Multwomap k v -> Multwomap k v #

min :: Multwomap k v -> Multwomap k v -> Multwomap k v #

union :: Ord k => Multwomap k v -> Multwomap k v -> Multwomap k v Source #

insert :: Ord k => k -> v -> Multwomap k v -> Multwomap k v Source #

arbitraryKey :: Multwomap k v -> Maybe k Source #

Get an arbitrary key contained in the Multwomap, or Nothing if it’s empty.

extract :: Ord k => k -> Multwomap k v -> Maybe (v, Multwomap k v) Source #

Extract the value to the corresponding key, and return the Multwomap with the key removed.