sequential-index: Sequential numbers that allow arbitrarily inserting numbers - for containers

[ bsd3, data, library ] [ Propose Tags ] [ Report a vulnerability ]

Sequential index numbers between 0.0 and 1.0 that allow arbitrarily inserting new numbers in between. They can possibly used for disk-based and other special containers, where adding a new element without changing the indexes of the other elements is important. Conceptually, SequentialIndex denotes a path to an element in an imaginary binary tree. However, leafs can only be on the right side of their parent. I.e. the path must end with a '1' (or be the path to the root node, 0.0). 1.0 denotes the invalid node.


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.0, 0.1, 0.2, 0.2.0.1
Dependencies base (>=4.2.0.0 && <5), bytestring (>=0.9.1.5 && <0.11) [details]
License BSD-3-Clause
Copyright Copyright (C) 2011 Aristid Breitkreuz
Author Aristid Breitkreuz
Maintainer aristidb@googlemail.com
Category Data
Home page https://github.com/aristidb/sequential-index
Uploaded by AristidBreitkreuz at 2013-01-29T14:50:34Z
Distributions
Reverse Dependencies 2 direct, 3 indirect [details]
Downloads 3298 total (23 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for sequential-index-0.2.0.1

[back to package description]
Sequential index numbers between 0.0 and 1.0 that allow arbitrarily inserting new numbers in between. They can possibly used for disk-based and other special containers, where adding a new element without changing the indexes of the other elements is important.

Conceptually, SequentialIndex denotes a path to an element in an imaginary binary tree, with a '1' at the end. Except for 0.0 and 1.0, which are logically on the left or on the right of the entire tree.

So logically, the tree looks roughly like this:

0.0                          1.0
                            /
                /----------/
              0.1
              / \
          /--/   \--\
         /           \
       0.01         0.11
       / \          / \
  0.001   0.011     ...

Note that 0.0 is not connected to any other node, but it is still logically smaller than all nodes.