more-containers-0.2.2.0: A few more collections

Safe HaskellNone
LanguageHaskell2010

Data.Multimap.List

Description

This module provides list-specific multimap functionality.

Synopsis

Documentation

type ListMultimap = Multimap [] Source #

A multimap with list values. Note that lists do not support efficient appends or sizing, so several multimap operations will have higher complexity than for other collections. If performance is a concern, consider using a SeqMultimap instead.

See Data.Multimap.List for operations specific to this type.

cons :: Ord k => k -> v -> ListMultimap k v -> ListMultimap k v Source #

O(log m) Prepends a value to a given key.

uncons :: (Ord k, Ord v) => k -> ListMultimap k v -> Maybe (v, ListMultimap k v) Source #

O(log m) Extracts the first value associated with a given key, if possible.