| examples | ||
| tests | ||
| .gitignore | ||
| .merlin | ||
| .ocamlinit | ||
| _tags | ||
| cache.ml | ||
| cache.mli | ||
| cC.ml | ||
| cC.mli | ||
| containers.mllib | ||
| containers.odocl | ||
| deque.ml | ||
| deque.mli | ||
| fHashtbl.ml | ||
| fHashtbl.mli | ||
| flatHashtbl.ml | ||
| flatHashtbl.mli | ||
| fQueue.ml | ||
| fQueue.mli | ||
| future.ml | ||
| future.mli | ||
| gen.ml | ||
| gen.mli | ||
| graph.ml | ||
| graph.mli | ||
| hashset.ml | ||
| hashset.mli | ||
| heap.ml | ||
| heap.mli | ||
| json.ml | ||
| json.mli | ||
| lazyGraph.ml | ||
| lazyGraph.mli | ||
| leftistheap.ml | ||
| leftistheap.mli | ||
| LICENSE | ||
| Makefile | ||
| persistentHashtbl.ml | ||
| persistentHashtbl.mli | ||
| pHashtbl.ml | ||
| pHashtbl.mli | ||
| puf.ml | ||
| puf.mli | ||
| README.md | ||
| sequence.ml | ||
| sequence.mli | ||
| skipList.ml | ||
| skipList.mli | ||
| splayMap.ml | ||
| splayMap.mli | ||
| splayTree.ml | ||
| splayTree.mli | ||
| thread_containers.mllib | ||
| univ.ml | ||
| univ.mli | ||
| utils.ml | ||
| vector.ml | ||
| vector.mli | ||
ocaml-containers
A bunch of containers,written in different occasions. Not all
containers are properly tested (see tests/ and make tests
if you have installed OUnit).
The design is centerred around polymorphism rather than functors. Such structures comprise:
PHashtbl, a polymorphic hashtable (with open addressing)SplayTree, a polymorphic splay heap implementation (not quite finished)SplayMap, a polymorphic functional map based on splay treesHeap, an imperative heap based onSplayTreeGraph, a polymorphic imperative directed graph (on top ofPHashtbl)Hashset, a polymorphic imperative set on top ofPHashtblLazyGraph, a lazy graph structure on arbitrary (hashable+eq) types, with basic graph functions that work even on infinite graphs, and printing to DOT.FQueue, a purely functional queue structureHeap, a purely functional polymorphic heap
Other structures are:
Univ, a universal type encoding with affectationCache, a low level memoization cache for unary and binary functionsPersistentHashtbl, a semi-persistent hashtable (similar to persistent arrays)Deque, an imperative double ended FIFO (double-linked list)Future, a set of tools for preemptive threading, including a thread pool, monadic futures, and MVars (concurrent boxes)Vector, a growable array (pure OCaml, no C; not tested)FlatHashtbl, a (deprecated) open addressing hashtable with a functorial interface (replaced by PHashtbl)
Use
You can either build and install the library (see Build), or just copy
files to your own project. The last solution has the benefits that you
don't have additional dependencies nor build complications (and it may enable
more inlining). I therefore recommand it for its simplicity.
If you have comments, requests, or bugfixes, please share them! :-)
Build
There are no dependencies (Sequence is included). Type:
$ make
To build and run tests (requires oUnit):
$ opam install oUnit
$ make tests
$ ./tests.native
To build the small benchmarking suite (requires Bench):
$ opam install bench
$ make bench
$ ./benchs.native
License
This code is free, under the BSD license.