Skip to content

Commit

Permalink
Merge branch 'master' into stable for 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
c-cube committed Feb 11, 2017
2 parents 265ed02 + 25b714c commit e52b847
Show file tree
Hide file tree
Showing 168 changed files with 8,230 additions and 16,070 deletions.
1 change: 0 additions & 1 deletion .merlin
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ PKG threads.posix
PKG lwt
PKG bigarray
PKG sequence
PKG hamt
PKG gen
PKG qcheck
FLG -w +a -w -4 -w -44
1 change: 1 addition & 0 deletions .ocamlinit
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#use "topfind";;
#thread
#require "result";;
#require "bigarray";;
#require "unix";;
#require "sequence";;
Expand Down
1 change: 1 addition & 0 deletions AUTHORS.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@
- Johannes Kloos
- Geoff Gole (@gsg)
- Roma Sokolov (@little-arhat)
- Malcolm Matalka (`orbitz`)
- David Sheets (@dsheets)
63 changes: 63 additions & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,68 @@
= Changelog

== 1.0

See https://github.com/c-cube/ocaml-containers/issues/84 for an overview.

**Breaking and Removals**:

- simplify and cleanup of CCGraph
- remove poly-variant based errors, use `result` everywhere
- remove deprecated functions and modules
- remove `CCVHashconsedSet`
- remove `CCAllocCache`
- remove `CCBloom`
- update benchmarks (ignoring hamt); remove useless old script
- simplify `CCHash`, changing the type to `'a -> int`, relying on
`Hashtbl.seeded_hash` for combining hashes
- split `CCList.Zipper` into its own module, `CCZipper` in containers.data
- change argument ordering in `CCList.Assoc`
- remove `CCList.Idx`, rename its functions to toplevel
- remove `CCList.Set`, move functions to toplevel and rename them
- rewrite `CCBitField` with a much simpler interface
- split `CCArray.Sub` into `CCArray_slice`
- remove containers.string
* remove CCParse and CCKMP (will be replaced in core)
- `CCFormat`:
* remove `start/stop` args, make `sep` a `unit printer`
* many other improvements and additions
* add `CCFormat.tee`
* add `CCFormat.Dump.{result,to_string}`
- replace `or_` by `default` in labelled functions
- remove trailing `_` in `CCOrd` primitives
- remove `containers.io` (deprecated for a while)
- remove `containers.bigarray`
- remove `CCSexpM`, use ocamllex for a much simpler `CCSexp` using ocamllex
- add `CCParse` into core, a simple, lightweight version of parser combs
- remove `CCPrint`, use `CCFormat` instead (also, update tests relying on it)
- remove containers.advanced
- change type of `CCUnix.escape_str`

**Additions**:

- `CCHashtbl`:
* `CCHash.{list,array}_comm`
* `CCHashtbl.Poly` and fix issue in Containers (close #46)
* `CCHashtbl.get_or_add`
- `CCList.sublists_of_len` (close #97)
- `Char.{of_int{,_exn},to_int}` (close #95)
- Add `CCResult.{is_ok,is_error}`
- improve `CCUnix` a bit
- update `containers.ml` so as to include all core containers
- add `CCOrd.Infix`
- use `Labels` versions of `CCList` and `CCArray`
- add `CCString.edit_distance`
- expose `CCString.Find` for efficient sub-string searching

**Bugfixes**:

- `CCIO`: deal properly with broken symlinks and permission errors
- test for #94 (using Thread.yield to trigger segfault)
Fix `CCSemaphore.with_acquire`: release a non locked mutex is UB
- containers.top: remove printers on structural types (#71)
- add doc for `of_list` in relevant modules (close #85)
- bugfix: do not use `Sequence.flatMap` (close #90)

== 0.22

- threads/CCLock: add `try_with_lock` to wrap `Mutex.try_lock`
Expand Down
11 changes: 6 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,22 +57,18 @@ push_doc_gh: doc
cp -r containers.docdir/* dev/ && \
git add --all dev

DONTTEST=myocamlbuild.ml setup.ml $(wildcard src/**/*.cppo.*)
DONTTEST=myocamlbuild.ml setup.ml $(wildcard src/**/*.cppo.*) $(wildcard src/**/*Labels*)
QTESTABLE=$(filter-out $(DONTTEST), \
$(wildcard src/core/*.ml) \
$(wildcard src/core/*.mli) \
$(wildcard src/data/*.ml) \
$(wildcard src/data/*.mli) \
$(wildcard src/string/*.ml) \
$(wildcard src/string/*.mli) \
$(wildcard src/io/*.ml) \
$(wildcard src/io/*.mli) \
$(wildcard src/unix/*.ml) \
$(wildcard src/unix/*.mli) \
$(wildcard src/sexp/*.ml) \
$(wildcard src/sexp/*.mli) \
$(wildcard src/advanced/*.ml) \
$(wildcard src/advanced/*.mli) \
$(wildcard src/iter/*.ml) \
$(wildcard src/iter/*.mli) \
$(wildcard src/bigarray/*.ml) \
Expand Down Expand Up @@ -136,4 +132,9 @@ watch:
make all; \
done

reindent:
@which ocp-indent || ( echo "require ocp-indent" ; exit 1 )
@find src '(' -name '*.ml' -or -name '*.mli' ')' -type f -print0 | xargs -0 echo "reindenting: "
@find src '(' -name '*.ml' -or -name '*.mli' ')' -type f -print0 | xargs -0 ocp-indent -i

.PHONY: examples push_doc tags qtest-gen qtest-clean devel update_next_tag
45 changes: 9 additions & 36 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,12 @@ cross-module dependencies).
containers.data:: with additional data structures that don't have an
equivalent in the standard library;
containers.io:: (deprecated)
containers.iter:: with list-like and tree-like iterators;
containers.string:: (in directory `string`) with
a few packed modules that deal with strings (Levenshtein distance,
KMP search algorithm, and a few naive utils). Again, modules are independent
and sometimes parametric on the string and char types (so they should
be able to deal with your favorite unicode library).
- A sub-library with complicated abstractions, `containers.advanced` (with
a LINQ-like query module, batch operations using GADTs, and others).
- Utilities around the `unix` library in `containers.unix` (mainly to spawn
sub-processes)
- A bigstring module using `bigarray` in `containers.bigarray` (*deprecated*)
- A lightweight S-expression printer and streaming parser in `containers.sexp`
Some of the modules have been moved to their own repository (e.g. `sequence`,
Expand Down Expand Up @@ -103,9 +96,10 @@ sequence:: `'a sequence = (unit -> 'a) -> unit` is also an iterator type.
It is easier to define on data structures than `gen`, but it a bit less
powerful. The opam library https://github.com/c-cube/sequence[sequence]
can be used to consume and produce values of this type.
error:: `'a or_error = [`Error of string | `Ok of 'a]` is a error type
that is used in other libraries, too. The reference module in containers
is `CCError`.
error:: (DEPRECATED) `'a or_error = [`Error of string | `Ok of 'a]` is a error type
that is used in other libraries, too. It is now deprecated and
replaced with `('a, string) Result.result`, supported in
`CCResult`.
klist:: `'a klist = unit -> [`Nil | `Cons of 'a * 'a klist]` is a lazy list
without memoization, used as a persistent iterator. The reference
module is `CCKList` (in `containers.iter`).
Expand All @@ -125,7 +119,8 @@ Documentation http://cedeela.fr/~simon/software/containers[here].
- `CCHeap`, a purely functional heap structure
- `CCVector`, a growable array (pure OCaml, no C) with mutability annotations
- `CCList`, functions on lists, including tail-recursive implementations of `map` and `append` and many other things
- `CCArray`, utilities on arrays and slices
- `CCArray`, utilities on arrays
- `CCArray_slice`, array slices
- `CCHashtbl`, `CCMap` extensions of the standard modules `Hashtbl` and `Map`
- `CCInt`
- `CCString` (basic string operations)
Expand All @@ -136,9 +131,8 @@ Documentation http://cedeela.fr/~simon/software/containers[here].
- `CCFloat`
- `CCOrd` (combinators for total orderings)
- `CCRandom` (combinators for random generators)
- `CCPrint` (printing combinators)
- `CCHash` (hashing combinators)
- `CCError` (monadic error handling, very useful)
- `CCResult` (monadic error handling, very useful)
- `CCIO`, basic utilities for IO (channels, files)
- `CCInt64,` utils for `int64`
- `CCChar`, utils for `char`
Expand All @@ -147,7 +141,6 @@ Documentation http://cedeela.fr/~simon/software/containers[here].
=== Containers.data

- `CCBitField`, bitfields embedded in integers
- `CCBloom`, a bloom filter
- `CCCache`, memoization caches, LRU, etc.
- `CCFlatHashtbl`, a flat (open-addressing) hashtable functorial implementation
- `CCTrie`, a prefix tree
Expand All @@ -163,19 +156,13 @@ Documentation http://cedeela.fr/~simon/software/containers[here].
with batch operations
- `CCIntMap`, map specialized for integer keys based on Patricia Trees,
with fast merges
- `CCHashconsedSet`, a set structure with sharing of sub-structures
- `CCGraph`, a small collection of graph algorithms
- `CCBitField`, a type-safe implementation of bitfields that fit in `int`
- `CCWBTree`, a weight-balanced tree, implementing a map interface
- `CCRAL`, a random-access list structure, with `O(1)` cons/hd/tl and `O(ln(n))`
access to elements by their index.
- `CCImmutArray`, immutable interface to arrays

=== Containers.io

*deprecated*, `CCIO` is now a <<core,core>> module. You can still install it and
depend on it but it contains no useful module.

=== Containers.unix

- `CCUnix`, utils for `Unix`
Expand All @@ -193,20 +180,6 @@ Iterators:
- `CCKList`, a persistent iterator structure (akin to a lazy list, without memoization)
- `CCKTree`, an abstract lazy tree structure

=== String

In the module `Containers_string`:
- `Levenshtein`: edition distance between two strings
- `KMP`: Knuth-Morris-Pratt substring algorithm
- `Parse`: simple parser combinators

=== Advanced

In the module `Containers_advanced`:
- `CCLinq`, high-level query language over collections
- `CCCat`, a few categorical structures
- `CCBatch`, to combine operations on collections into one traversal

=== Thread

In the library `containers.thread`, for preemptive system threads:
Expand All @@ -229,7 +202,7 @@ The library has moved to https://github.com/c-cube/containers-misc .

== Documentation

In general, see http://c-cube.github.io/ocaml-containers/ or
In general, see http://c-cube.github.io/ocaml-containers/ or
http://cedeela.fr/~simon/software/containers

by version:
Expand Down Expand Up @@ -258,7 +231,7 @@ branch `stable` it is not necessary.
To build and run tests (requires `oUnit` and https://github.com/vincent-hugot/iTeML[qtest]):

$ opam install oUnit qtest
$ ./configure --enable-tests --enable-unix --enable-bigarray
$ ./configure --enable-tests --enable-unix
$ make test

To build the small benchmarking suite (requires https://github.com/chris00/ocaml-benchmark[benchmark]):
Expand Down
Loading

0 comments on commit e52b847

Please sign in to comment.