A lightweight, modular standard library extension, string library, and interfaces to various libraries (unix, threads, etc.) BSD license.
Find a file
2013-03-25 14:37:27 +01:00
examples forgot to update examples/ 2013-03-21 17:35:23 +01:00
tests added a test for Future.Timer 2013-03-24 20:27:27 +01:00
.gitignore Gen.lexico for lexicographic comparison 2013-03-25 14:37:27 +01:00
.merlin
.ocamlinit forgot to update examples/ 2013-03-21 17:35:23 +01:00
_tags
cache.ml
cache.mli correct comments for ocamldoc 2013-03-22 17:42:09 +01:00
containers.mllib skipList module 2013-03-23 01:00:13 +01:00
deque.ml
deque.mli
fHashtbl.ml
fHashtbl.mli
flatHashtbl.ml
flatHashtbl.mli
fQueue.ml
fQueue.mli
future.ml added a test for Future.Timer 2013-03-24 20:27:27 +01:00
future.mli added a timer in Future 2013-03-24 19:21:43 +01:00
gen.ml Gen.lexico for lexicographic comparison 2013-03-25 14:37:27 +01:00
gen.mli Gen.lexico for lexicographic comparison 2013-03-25 14:37:27 +01:00
graph.ml
graph.mli
hashset.ml
hashset.mli correct comments for ocamldoc 2013-03-22 17:42:09 +01:00
heap.ml
heap.mli
lazyGraph.ml
lazyGraph.mli
LICENSE
Makefile
pHashtbl.ml
pHashtbl.mli correct comments for ocamldoc 2013-03-22 17:42:09 +01:00
README.md
sequence.ml
sequence.mli
skipList.ml faster SkipList.find 2013-03-23 01:45:46 +01:00
skipList.mli skipList module 2013-03-23 01:00:13 +01:00
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
  • Heap, an imperative heap based on SplayTree
  • Graph, a polymorphic imperative directed graph (on top of PHashtbl)
  • Hashset, a polymorphic imperative set on top of PHashtbl
  • FQueue, a purely functional queue structure
  • Heap, a purely functional polymorphic heap

Other structures are:

  • Univ, a universal type encoding with affectation
  • Cache, a low level memoization cache for unary and binary functions
  • Deque, an imperative double ended FIFO (double-linked list)
  • 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.