A lightweight, modular standard library extension, string library, and interfaces to various libraries (unix, threads, etc.) BSD license.
Find a file
Simon Cruanes 23029332df added Futures.is_done function;
.ocamlinit file to import stuff in the toplevel
2013-03-19 15:10:41 +01:00
tests moved generator functions into Enum.Gen 2013-03-19 11:44:48 +01:00
.gitignore tags 2013-03-14 14:42:53 +01:00
.merlin modified build system and other data for threading support 2013-03-19 15:04:42 +01:00
.ocamlinit added Futures.is_done function; 2013-03-19 15:10:41 +01:00
_tags modified build system and other data for threading support 2013-03-19 15:04:42 +01:00
cache.ml changed interface of Cache.S.with_cache_rec 2013-03-07 18:12:35 +01:00
cache.mli changed interface of Cache.S.with_cache_rec 2013-03-07 18:12:35 +01:00
containers.mllib stubs for LazyGraph functions; 2013-03-19 00:32:37 +01:00
deque.ml rewrote Deque to be safe (no Obj anymore); 2013-03-14 14:14:13 +01:00
deque.mli rewrote Deque to be safe (no Obj anymore); 2013-03-14 14:14:13 +01:00
enum.ml fixed absurd comment; 2013-03-19 13:43:02 +01:00
enum.mli fixed absurd comment; 2013-03-19 13:43:02 +01:00
fHashtbl.ml added a is_empty function for FHashtbl; 2013-03-10 15:04:38 +01:00
fHashtbl.mli added a is_empty function for FHashtbl; 2013-03-10 15:04:38 +01:00
flatHashtbl.ml fixed bug in FlatHashtbl.remove 2013-03-07 10:12:47 +01:00
flatHashtbl.mli updated the implementation of flatHashtbl: 2013-03-07 10:07:13 +01:00
fQueue.ml added a functional Queue implementation 2013-03-09 20:35:45 +01:00
fQueue.mli added a functional Queue implementation 2013-03-09 20:35:45 +01:00
futures.ml added Futures.is_done function; 2013-03-19 15:10:41 +01:00
futures.mli added Futures.is_done function; 2013-03-19 15:10:41 +01:00
graph.ml bugfix: Graph.is_dag must explore every vertex 2013-03-07 16:55:50 +01:00
graph.mli more graph tests 2013-03-05 11:39:34 +01:00
hashset.ml hashset.union/inter take an optional argument for the resulting set 2013-03-04 17:30:34 +01:00
hashset.mli hashset.union/inter take an optional argument for the resulting set 2013-03-04 17:30:34 +01:00
heap.ml imperative heaps on top of splay trees 2013-03-05 11:05:12 +01:00
heap.mli imperative heaps on top of splay trees 2013-03-05 11:05:12 +01:00
lazyGraph.ml stubs for LazyGraph functions; 2013-03-19 00:32:37 +01:00
lazyGraph.mli stubs for LazyGraph functions; 2013-03-19 00:32:37 +01:00
LICENSE gitignore and update of readme; added LICENSE file (BSD) 2013-02-27 16:12:14 +01:00
Makefile modified build system and other data for threading support 2013-03-19 15:04:42 +01:00
pHashtbl.ml updated benchmark 2013-03-05 00:55:24 +01:00
pHashtbl.mli robin hood hashing for PHashtbl 2013-03-05 00:49:02 +01:00
README.md update of README and .mllib 2013-03-14 14:45:33 +01:00
sequence.ml a bugfix in Sequence.product; 2013-03-08 16:04:16 +01:00
sequence.mli updated sequence files 2013-03-08 15:44:43 +01:00
splayTree.ml splay heaps are implemented 2013-03-05 11:05:00 +01:00
splayTree.mli splay heaps are implemented 2013-03-05 11:05:00 +01:00
thread_containers.mllib modified build system and other data for threading support 2013-03-19 15:04:42 +01:00
univ.ml cleanrer interface for Univ 2013-03-14 14:43:08 +01:00
univ.mli cleanrer interface for Univ 2013-03-14 14:43:08 +01:00
utils.ml rewrote Deque to be safe (no Obj anymore); 2013-03-14 14:14:13 +01:00
vector.ml force Vector's initial size to be >= 3 2013-03-17 18:45:53 +01:00
vector.mli small updates of Vector; 2013-03-17 18:43:46 +01:00

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.