map-exts

Extensions to Data.Map http://github.com/charles-cooper/map-exts#readme

Latest on Hackage:0.2.0.0

This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow stackage.org to host generated Haddocks.

BSD3 licensed by Charles Cooper

map-extensions

This module contains some extensions to Data.Map. Some of them are convenience functions.

It also contains functions to support a split-apply-combine workflow, by representing labeled, multi-dimensional data as multiply nested Maps. For instance, a two dimensional matrix with one axis indexed by 'Name's and the other axis labeled by 'Job's, we would represent such a structure with a Lookup2 Name Job Double. Such a structure is not terribly efficient (it takes O(n log(n)) space and O(log(n)) time for insert/update/delete operations with high constant factor owing to all the pointer manipulation), but it is expressive.

Here is the rough correspondence between split-apply-combine and the verbs used in this package:

split : groupBy

apply : fmap

combine : foldr/foldMap

reshape : transpose

For more information, see the examples.

Changes

0.2.0.0 Remove functions which are superseded by upstream

containers has added take, drop, restrictKeys and withoutKeys which are equivalent to take, drop, keepKeys and dropKeys from the map-exts API, respectively. takeLeft/Right and dropLeft/Right have been exposed.

containers:drop/take correspond to dropLeft and takeLeft respectively.

map-exts is now compatible with lts-10.3

0.1.1.0 Add version bound for upstream containers

0.1.0.1 Improve documentation, examples

Depends on 4 packages:
Used by 1 package:
comments powered byDisqus