A lightweight, modular standard library extension, string library, and interfaces to various libraries (unix, threads, etc.) BSD license.
Find a file
2013-05-15 16:41:32 +02:00
examples example updated 2013-03-31 22:46:14 +02:00
tests Bij.{guard,fix} helpers 2013-05-15 15:11:54 +02:00
.gitignore target for documentation of some modules 2013-04-03 00:01:52 +02:00
.merlin example file, that uses LazyGraph to represent memory layout of values (and compute their size) 2013-03-20 10:32:11 +01:00
.ocamlinit small changes 2013-04-05 17:34:06 +02:00
_tags example using LazyGraph and Futures to search a path between two urls 2013-03-30 14:41:07 +01:00
bij.ml 4-ary and 5-ary tuples in Bij 2013-05-15 16:41:32 +02:00
bij.mli 4-ary and 5-ary tuples in Bij 2013-05-15 16:41:32 +02:00
cache.ml changed interface of Cache.S.with_cache_rec 2013-03-07 18:12:35 +01:00
cache.mli correct comments for ocamldoc 2013-03-22 17:42:09 +01:00
cC.ml added CC (congruence closure with curryfied terms); 2013-04-17 15:43:19 +02:00
cC.mli added CC (congruence closure with curryfied terms); 2013-04-17 15:43:19 +02:00
containers.mllib Bij module, a try at the serialization problem using GADT 2013-05-14 18:32:23 +02:00
containers.odocl Bij module, a try at the serialization problem using GADT 2013-05-14 18:32:23 +02: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
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
future.ml cleanup of LazyGraph 2013-03-29 23:16:17 +01:00
future.mli target for documentation of some modules 2013-04-03 00:01:52 +02:00
gen.ml added Gen.compare and Gen.eq functions 2013-04-02 23:48:51 +02:00
gen.mli doc for infix functions of Gen 2013-04-03 00:14:48 +02: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 correct comments for ocamldoc 2013-03-22 17:42:09 +01:00
heap.ml leaner Heap 2013-03-20 15:54:45 +01:00
heap.mli copied code of SplayTree into Heap, to reduce dependencies 2013-03-20 15:49:52 +01:00
json.ml forgot the case for strings 2013-04-12 18:19:55 +02:00
json.mli basic json parser/printer using Genlex 2013-04-12 18:12:33 +02:00
lazyGraph.ml LazyGraph.limit_depth implemented 2013-03-31 22:23:26 +02:00
lazyGraph.mli target for documentation of some modules 2013-04-03 00:01:52 +02:00
leftistheap.ml minor update of Leftistheap 2013-04-24 00:31:47 +02:00
leftistheap.mli minor update of Leftistheap 2013-04-24 00:31:47 +02:00
LICENSE gitignore and update of readme; added LICENSE file (BSD) 2013-02-27 16:12:14 +01:00
Makefile build lib when tests are built 2013-05-15 10:27:21 +02:00
persistentHashtbl.ml added PersistentHashtbl, adapted from persistent arrays of J-C Filliatre 2013-03-26 17:23:19 +01:00
persistentHashtbl.mli added PersistentHashtbl, adapted from persistent arrays of J-C Filliatre 2013-03-26 17:23:19 +01:00
pHashtbl.ml updated benchmark 2013-03-05 00:55:24 +01:00
pHashtbl.mli correct comments for ocamldoc 2013-03-22 17:42:09 +01:00
puf.ml added CC (congruence closure with curryfied terms); 2013-04-17 15:43:19 +02:00
puf.mli added CC (congruence closure with curryfied terms); 2013-04-17 15:43:19 +02:00
README.md small update of the makefile 2013-05-15 13:42:20 +02: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
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
splayMap.ml functorial version of SplayMap 2013-05-01 17:21:09 +02:00
splayMap.mli functorial version of SplayMap 2013-05-01 17:21:09 +02: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 renamed Futures into Future 2013-03-20 15:27:44 +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 update of Vector, with more functions (length, rev, append_seq...) 2013-04-22 18:32:23 +02:00
vector.mli update of Vector, with more functions (length, rev, append_seq...) 2013-04-22 18:32:23 +02: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 mostly centered 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 trees
  • 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
  • LazyGraph, 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 structure
  • Heap, a purely functional polymorphic heap
  • Bij, a GADT-based bijection language used to serialize/deserialize your data structures

Other structures are:

  • Univ, a universal type encoding with affectation
  • Cache, a low level memoization cache for unary and binary functions
  • PersistentHashtbl, 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). The Bij module requires OCaml >= 4.00. 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.