A lightweight, modular standard library extension, string library, and interfaces to various libraries (unix, threads, etc.) BSD license.
Find a file
2014-03-05 01:09:48 +01:00
cgi moved cgi in a subdir (would not build with oasis 0.4 otherwise) 2013-12-30 12:20:05 +01:00
examples moved cgi in a subdir (would not build with oasis 0.4 otherwise) 2013-12-30 12:20:05 +01:00
tests benchmark Conv.from (from json) 2014-03-02 16:06:33 +01:00
threads moved futures into threads/ and updated oasis; added benchmark for Conv 2014-03-01 16:30:52 +01:00
.gitignore gitignore 2013-10-28 11:04:39 +01:00
.header header file for license 2013-09-01 21:20:36 +02:00
.merlin Behavior is now based on Lwt rather than React, using futures. 2013-06-05 11:06:16 +02:00
.ocamlinit smallish parser for HGraph 2013-12-01 23:36:23 +01:00
_oasis Levenshtein automaton for fuzzy string searching 2014-03-03 23:09:56 +01:00
_tags Levenshtein automaton for fuzzy string searching 2014-03-03 23:09:56 +01:00
absSet.ml new container, AbsSet, that presents an abstract view of sets 2013-08-20 23:33:14 +02:00
absSet.mli new container, AbsSet, that presents an abstract view of sets 2013-08-20 23:33:14 +02:00
actionMan.ml ultimate monadic CLI argument parser!! 2013-09-10 12:36:10 +02:00
actionMan.mli ultimate monadic CLI argument parser!! 2013-09-10 12:36:10 +02:00
automaton.ml expose more functions in Automaton 2013-12-30 17:59:39 +01:00
automaton.mli expose more functions in Automaton 2013-12-30 17:59:39 +01:00
behavior.ml Behavior is now based on Lwt rather than React, using futures. 2013-06-05 11:06:16 +02:00
behavior.mli Behavior is now based on Lwt rather than React, using futures. 2013-06-05 11:06:16 +02:00
bencode.ml Bencode: sequence bencode <-> sequence string; 2013-10-09 19:01:19 +02:00
bencode.mli Bencode: sequence bencode <-> sequence string; 2013-10-09 19:01:19 +02:00
bencode_write_par.sh BencodeOnDisk module, to write Bencode values in a file in an 2013-10-09 18:40:45 +02:00
bencodeOnDisk.ml Bencode: sequence bencode <-> sequence string; 2013-10-09 19:01:19 +02:00
bencodeOnDisk.mli Bencode: sequence bencode <-> sequence string; 2013-10-09 19:01:19 +02:00
bij.ml Bij.TrBencode with more functions; 2013-09-28 10:40:25 +02:00
bij.mli better doc 2013-09-30 22:24:57 +02:00
BV.ml added BV.select/selecti (break api) functions 2013-11-26 15:46:40 +01:00
BV.mli added BV.select/selecti (break api) functions 2013-11-26 15:46:40 +01:00
cache.ml updated caches to handle exceptions 2013-11-20 12:33:59 +01:00
cache.mli updated caches to handle exceptions 2013-11-20 12:33:59 +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
configure moved cgi in a subdir (would not build with oasis 0.4 otherwise) 2013-12-30 12:20:05 +01:00
containers.mldylib updated oasis to 4.xxx 2014-02-26 12:10:17 +01:00
containers.mllib moved cgi in a subdir (would not build with oasis 0.4 otherwise) 2013-12-30 12:20:05 +01:00
containers.mlpack Levenshtein automaton for fuzzy string searching 2014-03-03 23:09:56 +01:00
containers.odocl Levenshtein automaton for fuzzy string searching 2014-03-03 23:09:56 +01:00
containers_cgi.mllib use oasis to build files, splitted into libraries, including 2013-10-18 22:27:43 +02:00
containers_lwt.mldylib updated oasis to 4.xxx 2014-02-26 12:10:17 +01:00
containers_lwt.mllib Lwt_automaton, for an interface with Lwt 2013-12-30 16:24:18 +01:00
containers_lwt.mlpack Lwt_automaton, for an interface with Lwt 2013-12-30 16:24:18 +01:00
conv.ml removed useless "rec" 2014-03-04 13:20:44 +01:00
conv.mli more efficient and simple serialization, using 2014-03-01 18:53:26 +01:00
CSM.ml updated csm 2013-09-01 21:37:31 +02:00
CSM.mli updated csm 2013-09-01 21:37:31 +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 fixed .odocl and minor stuff 2013-06-12 17:36:59 +02: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
gen.ml richer api for Gen 2014-02-01 15:26:07 +01:00
gen.mli richer api for Gen 2014-02-01 15:26:07 +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
hGraph.ml smallish parser for HGraph 2013-12-01 23:36:23 +01:00
hGraph.mli smallish parser for HGraph 2013-12-01 23:36:23 +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 implemented LazyGraph.from_enum, and added from_list (simple interface); 2013-10-07 16:00:22 +02:00
lazyGraph.mli implemented LazyGraph.from_enum, and added from_list (simple interface); 2013-10-07 16:00:22 +02:00
leftistheap.ml added filter to leftistheap 2013-08-20 12:15:35 +02:00
leftistheap.mli added filter to leftistheap 2013-08-20 12:15:35 +02:00
levenshtein.ml small example in lenvenshtein 2014-03-05 01:09:48 +01:00
levenshtein.mli trie for indexing strings, to be later retrieved using Lenvenshtein automaton, 2014-03-05 00:45:53 +01:00
LICENSE gitignore and update of readme; added LICENSE file (BSD) 2013-02-27 16:12:14 +01:00
lwt_automaton.ml more functions in Lwt_automaton (automaton that reads/writes on a Unix FD) 2013-12-30 18:00:05 +01:00
lwt_automaton.mli more functions in Lwt_automaton (automaton that reads/writes on a Unix FD) 2013-12-30 18:00:05 +01:00
lwt_containers.mllib Behavior is now based on Lwt rather than React, using futures. 2013-06-05 11:06:16 +02:00
lwt_containers.odocl Behavior is now based on Lwt rather than React, using futures. 2013-06-05 11:06:16 +02:00
Makefile moved cgi in a subdir (would not build with oasis 0.4 otherwise) 2013-12-30 12:20:05 +01:00
META moved futures into threads/ and updated oasis; added benchmark for Conv 2014-03-01 16:30:52 +01:00
multiMap.ml more functions in MultiMap 2013-09-10 10:21:42 +02:00
multiMap.mli more functions in MultiMap 2013-09-10 10:21:42 +02:00
multiSet.ml is_empty in Multiset 2013-07-07 00:19:47 +02:00
multiSet.mli is_empty in Multiset 2013-07-07 00:19:47 +02:00
myocamlbuild.ml moved futures into threads/ and updated oasis; added benchmark for Conv 2014-03-01 16:30:52 +01:00
persistentGraph.ml fixed obsolete comment 2013-10-03 20:41:06 +02:00
persistentGraph.mli fixed obsolete comment 2013-10-03 20:41:06 +02:00
persistentHashtbl.ml update of persistent hashtable 2013-11-05 15:50:41 +01:00
persistentHashtbl.mli update of persistent hashtable 2013-11-05 15:50:41 +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
piCalculus.ml PiCalculus module, to emulate the Pi-calculus concurrency model; 2013-05-20 19:17:20 +02:00
piCalculus.mli PiCalculus module, to emulate the Pi-calculus concurrency model; 2013-05-20 19:17:20 +02: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
qCheck.ml updated QCheck 2013-10-29 00:31:42 +01:00
qCheck.mli updated QCheck 2013-10-29 00:31:42 +01:00
RAL.ml added Random-Access list implementation 2013-07-01 14:22:09 +02:00
RAL.mli added Random-Access list implementation 2013-07-01 14:22:09 +02:00
README.md HGraph draft, a generalized hypergraph structure. Yay. 2013-11-25 17:48:03 +01:00
sequence.ml update sequence 2013-10-20 22:03:10 +02:00
sequence.mli update sequence 2013-10-20 22:03:10 +02:00
setup.ml Levenshtein automaton for fuzzy string searching 2014-03-03 23:09:56 +01:00
sexp.ml Sexp module, for parsing and printing S-expressions incrementally 2013-06-25 16:22:34 +02:00
sexp.mli Sexp module, for parsing and printing S-expressions incrementally 2013-06-25 16:22:34 +02:00
show.ml Show: printing combinators 2013-10-11 22:22:23 +02:00
show.mli Show: printing combinators 2013-10-11 22:22:23 +02:00
skipList.ml use a new interface, unit -> 'a option, for Gen. 2014-01-30 01:41:51 +01:00
skipList.mli skipList module 2013-03-23 01:00:13 +01:00
smallSet.ml small set implementation, relying on a sorted list 2013-08-20 11:10:31 +02:00
smallSet.mli updated version of Sequence 2013-08-28 15:03:05 +02: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
thread_containers.odocl more modular build system, for thread-dependent or React-dependent modules 2013-05-31 11:41:43 +02:00
tTree.ml type declarations for the TTree associative structure 2013-11-08 00:20:29 +01:00
tTree.mli type declarations for the TTree associative structure 2013-11-08 00:20:29 +01:00
unionFind.ml imperative UnionFind structure 2013-08-20 11:30:08 +02:00
unionFind.mli imperative UnionFind structure 2013-08-20 11:30:08 +02:00
univ.ml simpler Univ.unpack implementation 2013-05-24 13:44:56 +02: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 documentation can be found here.

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
  • RAL, a random-access list structure, with O(1) cons/hd/tl and O(ln(n)) access to elements by their index.
  • Leftistheap, a polymorphic heap structure.
  • SmallSet, a sorted list implementation behaving like a set.
  • AbsSet, an abstract Set data structure, a bit like LazyGraph.

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)
  • Gen and Sequence, generic iterators structures.
  • UnionFind, a functorial imperative Union-Find structure.
  • HGraph, a structure of generalized hypergraphs

Some serialisation formats are also implemented, with a streaming, non-blocking interface that allows the user to feed the input in chunk by chunk (useful in combination with Lwt/Async). Currently, the modules are:

There is a QuickCheck-like library called QCheck.

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.