multi-containers-0.2: A few multimap variants.
MaintainerZiyang Liu <free@cofree.io>
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Multimap.Conversions

Description

Conversions between Multimap and SetMultimap.

Synopsis

Documentation

toMultimapAsc :: SetMultimap k a -> Multimap k a Source #

Convert a SetMultimap to a Multimap where the values of each key are in ascending order.

toMultimapAsc (Data.Multimap.Set.fromList [(1,'a'),(1,'b'),(2,'c')]) === Data.Multimap.fromList [(1,'a'),(1,'b'),(2,'c')]

toMultimapDesc :: SetMultimap k a -> Multimap k a Source #

Convert a SetMultimap to a Multimap where the values of each key are in descending order.

toMultimapDesc (Data.Multimap.Set.fromList [(1,'a'),(1,'b'),(2,'c')]) === Data.Multimap.fromList [(1,'b'),(1,'a'),(2,'c')]

toSetMultimap :: Ord a => Multimap k a -> SetMultimap k a Source #

Convert a Multimap to a SetMultimap.

toSetMultimap (Data.Multimap.fromList [(1,'a'),(1,'b'),(2,'c')]) === Data.Multimap.Set.fromList [(1,'a'),(1,'b'),(2,'c')]