|Version 7 (modified by jpbernardy, 8 years ago) (diff)|
Standard Collection Libraries
Provide the Haskell language a reliable, stable, coherent, efficient, function-rich collections library.
- Reliable: As few bugs as possible. This also implies the next goal, stability.
- The API should change as rarely as possible. API changes must be backward compatible.
- Changes in the behaviour should be rare as well, and for the generally-agreed better.
- Coherent: both behaviour and APIs should be coherent across the libraries, in order not to confuse the user.
- Efficient, feature-rich: Apart from the obvious, this means that more than one implementation will be needed in the long run.
API and policies
The existing Data.Map and Data.Set define a de-facto API. This API is important because many existing haskell programs use it. (See the corresponding haddock documentation for a "definition" of the API.)
Implementors of alternatives to Data.Map and Data.Set are advised to stick as closely as reasonably possible to the existing API. This would allow users to switch between implementations by just changing their import directive.
However, there are legitimate reasons not to strictly stick to the same interface. Should an implementor choose to do so, minor changes, or not-misleading changes, should be considered first. For example:
- Drop a function
- Change the context (constraints) of a function type
- Harmless changes in behaviour (ie. different asymptotic performance)
A important case, discussed at length in the mailing list, concerns left-biasing in Sets and key-sets of Maps in the presence of non-structural equality. Assuming structural equality (or not enforcing the left-bias) is considered a minor change, because few people actually rely on it in their programs.
Misleading changes are strongly discouraged:
- Changing the type of a function, besides the constraints.
- Reusing a name for a different purpose
- Using a different name for the same purpose
The definition of a set of classes for collection types is in progress. See the CollectionClassFramework for details.
- Standardized testing framework.
- Checks correctness of the libraries.
- The same is used independantly of the element types.
Short terms plans
- Have a consistent performance checker. #676
Long term plans & ideas
- Gather alternative collection implementations. Those must pass the regression tests. Note that this implies that they conform to the naming conventions already in place, or that compatibility layers are added.
Candidates for inclusion:
- Adrian Hey's AVL trees
- Use AVL trees implementation as default
- Performance tests should compute the complexity bounds automatically.