This is an attempt at providing more generic, safer merge functionality for maplike data structures. It has been proposed to the maintainers of the containers library as an issue.
There is a blogpost explaining the rationale for this project. This README is a more practical account of what this repository contains.
This is a slight rewrite of Kinoshita's witherable package, written to have a few dependencies as possible (and hence to make it suitable as a dependency for containers, if desired).
Contents:
-
An introduction to the package, the philosophy behind the decision to fork it, and an account of the changes.
-
Data structures which can have elements removed from them
-
As above, but indexed
-
Data structures which can have elements removed, but in a functor
-
As above, but indexed
This as the name suggests, is the core of the project: it consists of the merge functionality of Map and IntMap, rewritten with a shared, safer interface for merge tactics.
Contents:
-
A collection of merge tactics, replacing those for Map and IntMap
-
Some code for reindexing merge tactics, probably not of much use to the casual user
-
An indexed Maybe. Possibly instructive to the user as a simple example but also important in applications.
-
Merge functionality for IntMap
-
Merge functionality for Map
This is a toy implementation of an alternative Map data structure, backed by lists of key-value pairs sorted by order of key.
It is unlikely that anyone will want to use it but it might be a helpful tutorial for people wishing to implement other maplike data structures.
Contents:
-
List-backed maps.
This consists of a typeclass designed to reflect the functionality of
a type like Map
. It is intended as proof-of-concept rather than a
production implementation: it is not very full-featured.
Also implemented is a generic prefix tree map datatype, where the nodes can in turn be any Maplike datatype.
Contents:
-
The Maplike class
-
Generic prefix trees
This consists largely of the advanced functionality in Kinoshita's
witherable
package. The plan to make collections depend on
witherable
requires a version of witherable
with as few
dependencies as possible; this package contains extra functionality.
It is possible that some or all of this functionality could be moved into the packages on which it depends.
Contents:
-
Monad functionality, which could possibly be moved into transformers
-
Control/Monad/Transformers/Extra.hs
More of the same.
-
Some instances for functor compositions
-
Data/Functor/ExtraUndecidable.hs
More of the above
-
Instances for HashMap and HashSet (which could be moved into unordered-containers)
-
Some assorted functionality associated to the above
-
Instances for Vector (which could be moved into vector)