counterorbit.org

cows

2012-01-26: cows-0.2.tar.bz2 has wandered off again.
2011-11-22: cows had gone missing for many years but I recently found a copy of the source code on an old hard drive. I also found a partial Java implementation that I will make available once it is cleaned up (i.e., it compiles).

cows is a library of efficient "copy-on-write" data structures. Adding or removing an element from a cows collection creates a new collection and leaves the original one unmodified. The implementation uses advanced techniques to share as much data as possible between different versions of a collection.

cows is available for Python.

Downloads are available on the Files page.

This project is distributed under the GNU General Public License version 3.

Internals

The Python implementation of cows can emit pictures of the internal data structures.

References

  1. Chris Okasaki. Purely Functional Data Structures. Cambridge University Press, 1998.
  2. Ralf Hinze. Constructing Red-Black Trees. In Proceedings of Workshop on Algorithmic Aspects of Advanced Programming Languages, September 1999.

    http://citeseer.ist.psu.edu/hinze99constructing.html