Skip to content

Commit e52b847

Browse files
committed
Merge branch 'master' into stable for 1.0
2 parents 265ed02 + 25b714c commit e52b847

File tree

168 files changed

+8230
-16070
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

168 files changed

+8230
-16070
lines changed

.merlin

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ PKG threads.posix
2424
PKG lwt
2525
PKG bigarray
2626
PKG sequence
27-
PKG hamt
2827
PKG gen
2928
PKG qcheck
3029
FLG -w +a -w -4 -w -44

.ocamlinit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#use "topfind";;
22
#thread
3+
#require "result";;
34
#require "bigarray";;
45
#require "unix";;
56
#require "sequence";;

AUTHORS.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@
1616
- Johannes Kloos
1717
- Geoff Gole (@gsg)
1818
- Roma Sokolov (@little-arhat)
19+
- Malcolm Matalka (`orbitz`)
1920
- David Sheets (@dsheets)

CHANGELOG.adoc

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,68 @@
11
= Changelog
22

3+
== 1.0
4+
5+
See https://github.com/c-cube/ocaml-containers/issues/84 for an overview.
6+
7+
**Breaking and Removals**:
8+
9+
- simplify and cleanup of CCGraph
10+
- remove poly-variant based errors, use `result` everywhere
11+
- remove deprecated functions and modules
12+
- remove `CCVHashconsedSet`
13+
- remove `CCAllocCache`
14+
- remove `CCBloom`
15+
- update benchmarks (ignoring hamt); remove useless old script
16+
- simplify `CCHash`, changing the type to `'a -> int`, relying on
17+
`Hashtbl.seeded_hash` for combining hashes
18+
- split `CCList.Zipper` into its own module, `CCZipper` in containers.data
19+
- change argument ordering in `CCList.Assoc`
20+
- remove `CCList.Idx`, rename its functions to toplevel
21+
- remove `CCList.Set`, move functions to toplevel and rename them
22+
- rewrite `CCBitField` with a much simpler interface
23+
- split `CCArray.Sub` into `CCArray_slice`
24+
- remove containers.string
25+
* remove CCParse and CCKMP (will be replaced in core)
26+
- `CCFormat`:
27+
* remove `start/stop` args, make `sep` a `unit printer`
28+
* many other improvements and additions
29+
* add `CCFormat.tee`
30+
* add `CCFormat.Dump.{result,to_string}`
31+
- replace `or_` by `default` in labelled functions
32+
- remove trailing `_` in `CCOrd` primitives
33+
- remove `containers.io` (deprecated for a while)
34+
- remove `containers.bigarray`
35+
- remove `CCSexpM`, use ocamllex for a much simpler `CCSexp` using ocamllex
36+
- add `CCParse` into core, a simple, lightweight version of parser combs
37+
- remove `CCPrint`, use `CCFormat` instead (also, update tests relying on it)
38+
- remove containers.advanced
39+
- change type of `CCUnix.escape_str`
40+
41+
**Additions**:
42+
43+
- `CCHashtbl`:
44+
* `CCHash.{list,array}_comm`
45+
* `CCHashtbl.Poly` and fix issue in Containers (close #46)
46+
* `CCHashtbl.get_or_add`
47+
- `CCList.sublists_of_len` (close #97)
48+
- `Char.{of_int{,_exn},to_int}` (close #95)
49+
- Add `CCResult.{is_ok,is_error}`
50+
- improve `CCUnix` a bit
51+
- update `containers.ml` so as to include all core containers
52+
- add `CCOrd.Infix`
53+
- use `Labels` versions of `CCList` and `CCArray`
54+
- add `CCString.edit_distance`
55+
- expose `CCString.Find` for efficient sub-string searching
56+
57+
**Bugfixes**:
58+
59+
- `CCIO`: deal properly with broken symlinks and permission errors
60+
- test for #94 (using Thread.yield to trigger segfault)
61+
Fix `CCSemaphore.with_acquire`: release a non locked mutex is UB
62+
- containers.top: remove printers on structural types (#71)
63+
- add doc for `of_list` in relevant modules (close #85)
64+
- bugfix: do not use `Sequence.flatMap` (close #90)
65+
366
== 0.22
467

568
- threads/CCLock: add `try_with_lock` to wrap `Mutex.try_lock`

Makefile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,22 +57,18 @@ push_doc_gh: doc
5757
cp -r containers.docdir/* dev/ && \
5858
git add --all dev
5959

60-
DONTTEST=myocamlbuild.ml setup.ml $(wildcard src/**/*.cppo.*)
60+
DONTTEST=myocamlbuild.ml setup.ml $(wildcard src/**/*.cppo.*) $(wildcard src/**/*Labels*)
6161
QTESTABLE=$(filter-out $(DONTTEST), \
6262
$(wildcard src/core/*.ml) \
6363
$(wildcard src/core/*.mli) \
6464
$(wildcard src/data/*.ml) \
6565
$(wildcard src/data/*.mli) \
6666
$(wildcard src/string/*.ml) \
6767
$(wildcard src/string/*.mli) \
68-
$(wildcard src/io/*.ml) \
69-
$(wildcard src/io/*.mli) \
7068
$(wildcard src/unix/*.ml) \
7169
$(wildcard src/unix/*.mli) \
7270
$(wildcard src/sexp/*.ml) \
7371
$(wildcard src/sexp/*.mli) \
74-
$(wildcard src/advanced/*.ml) \
75-
$(wildcard src/advanced/*.mli) \
7672
$(wildcard src/iter/*.ml) \
7773
$(wildcard src/iter/*.mli) \
7874
$(wildcard src/bigarray/*.ml) \
@@ -136,4 +132,9 @@ watch:
136132
make all; \
137133
done
138134

135+
reindent:
136+
@which ocp-indent || ( echo "require ocp-indent" ; exit 1 )
137+
@find src '(' -name '*.ml' -or -name '*.mli' ')' -type f -print0 | xargs -0 echo "reindenting: "
138+
@find src '(' -name '*.ml' -or -name '*.mli' ')' -type f -print0 | xargs -0 ocp-indent -i
139+
139140
.PHONY: examples push_doc tags qtest-gen qtest-clean devel update_next_tag

README.adoc

Lines changed: 9 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,12 @@ cross-module dependencies).
2121
2222
containers.data:: with additional data structures that don't have an
2323
equivalent in the standard library;
24-
containers.io:: (deprecated)
2524
containers.iter:: with list-like and tree-like iterators;
26-
containers.string:: (in directory `string`) with
27-
a few packed modules that deal with strings (Levenshtein distance,
28-
KMP search algorithm, and a few naive utils). Again, modules are independent
29-
and sometimes parametric on the string and char types (so they should
30-
be able to deal with your favorite unicode library).
3125
3226
- A sub-library with complicated abstractions, `containers.advanced` (with
3327
a LINQ-like query module, batch operations using GADTs, and others).
3428
- Utilities around the `unix` library in `containers.unix` (mainly to spawn
3529
sub-processes)
36-
- A bigstring module using `bigarray` in `containers.bigarray` (*deprecated*)
3730
- A lightweight S-expression printer and streaming parser in `containers.sexp`
3831
3932
Some of the modules have been moved to their own repository (e.g. `sequence`,
@@ -103,9 +96,10 @@ sequence:: `'a sequence = (unit -> 'a) -> unit` is also an iterator type.
10396
It is easier to define on data structures than `gen`, but it a bit less
10497
powerful. The opam library https://github.com/c-cube/sequence[sequence]
10598
can be used to consume and produce values of this type.
106-
error:: `'a or_error = [`Error of string | `Ok of 'a]` is a error type
107-
that is used in other libraries, too. The reference module in containers
108-
is `CCError`.
99+
error:: (DEPRECATED) `'a or_error = [`Error of string | `Ok of 'a]` is a error type
100+
that is used in other libraries, too. It is now deprecated and
101+
replaced with `('a, string) Result.result`, supported in
102+
`CCResult`.
109103
klist:: `'a klist = unit -> [`Nil | `Cons of 'a * 'a klist]` is a lazy list
110104
without memoization, used as a persistent iterator. The reference
111105
module is `CCKList` (in `containers.iter`).
@@ -125,7 +119,8 @@ Documentation http://cedeela.fr/~simon/software/containers[here].
125119
- `CCHeap`, a purely functional heap structure
126120
- `CCVector`, a growable array (pure OCaml, no C) with mutability annotations
127121
- `CCList`, functions on lists, including tail-recursive implementations of `map` and `append` and many other things
128-
- `CCArray`, utilities on arrays and slices
122+
- `CCArray`, utilities on arrays
123+
- `CCArray_slice`, array slices
129124
- `CCHashtbl`, `CCMap` extensions of the standard modules `Hashtbl` and `Map`
130125
- `CCInt`
131126
- `CCString` (basic string operations)
@@ -136,9 +131,8 @@ Documentation http://cedeela.fr/~simon/software/containers[here].
136131
- `CCFloat`
137132
- `CCOrd` (combinators for total orderings)
138133
- `CCRandom` (combinators for random generators)
139-
- `CCPrint` (printing combinators)
140134
- `CCHash` (hashing combinators)
141-
- `CCError` (monadic error handling, very useful)
135+
- `CCResult` (monadic error handling, very useful)
142136
- `CCIO`, basic utilities for IO (channels, files)
143137
- `CCInt64,` utils for `int64`
144138
- `CCChar`, utils for `char`
@@ -147,7 +141,6 @@ Documentation http://cedeela.fr/~simon/software/containers[here].
147141
=== Containers.data
148142

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

174-
=== Containers.io
175-
176-
*deprecated*, `CCIO` is now a <<core,core>> module. You can still install it and
177-
depend on it but it contains no useful module.
178-
179166
=== Containers.unix
180167

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

196-
=== String
197-
198-
In the module `Containers_string`:
199-
- `Levenshtein`: edition distance between two strings
200-
- `KMP`: Knuth-Morris-Pratt substring algorithm
201-
- `Parse`: simple parser combinators
202-
203-
=== Advanced
204-
205-
In the module `Containers_advanced`:
206-
- `CCLinq`, high-level query language over collections
207-
- `CCCat`, a few categorical structures
208-
- `CCBatch`, to combine operations on collections into one traversal
209-
210183
=== Thread
211184

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

230203
== Documentation
231204

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

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

260233
$ opam install oUnit qtest
261-
$ ./configure --enable-tests --enable-unix --enable-bigarray
234+
$ ./configure --enable-tests --enable-unix
262235
$ make test
263236

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

0 commit comments

Comments
 (0)