Skip to content

Commit f24d983

Browse files
committed
Merge branch 'master' into stable for 1.3
2 parents 32bc045 + bedf9ec commit f24d983

38 files changed

+1353
-578
lines changed

AUTHORS.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,5 @@
2020
- David Sheets (@dsheets)
2121
- Glenn Slotte (glennsl)
2222
- @LemonBoy
23-
- Leonid Rozenberg (@rleonid)
23+
- Leonid Rozenberg (@rleonid)
24+
- Bikal Gurung (@bikalgurung)

CHANGELOG.adoc

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

3+
== 1.3
4+
5+
- deprecate `CCBool.negate`
6+
- add `CCString.compare_natural` (closes #146)
7+
- add callbacks in `CCCache.with_cache{,_rec}` (closes #140)
8+
- tail-rec `CCList.split` (by @bikalgurung, see #138)
9+
- change `CCRingBuffer.peek_{front,back}` to return options (closes #127)
10+
- add `CCRingBuffer.is_full`
11+
- add `CCArray.find_map{,_i}`, deprecated older names (closes #129)
12+
- add `CCList.{keep,all}_{some,ok}` (closes #124)
13+
- large refactor of `CCSimple_queue` (close #125)
14+
- add `CCSimple_queue` to containers.data
15+
- small change for consistency in `CCIntMap`
16+
17+
- bugfix in `CCRingBuffer.skip`, and corresponding tests
18+
- cleanup and refactor of `CCRingBuffer` (see #126). Add strong tests.
19+
- add rich testsuite to `CCIntMap`, based on @jmid's work
20+
321
== 1.2
422

523
- make many modules extensions of stdlib (close #109)

README.adoc

Lines changed: 48 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
A modular, clean and powerful extension of the OCaml standard library.
66

7+
https://c-cube.github.io/ocaml-containers/last/[(Jump to the current API documentation)].
8+
79
Containers is an extension of OCaml's standard library (under BSD license)
810
focused on data structures, combinators and iterators, without dependencies on
911
unix, str or num. Every module is independent and is prefixed with 'CC' in the
@@ -91,7 +93,7 @@ and <<tutorial,the tutorial below>> for a gentle introduction.
9193

9294
== Documentation
9395

94-
In general, see http://c-cube.github.io/ocaml-containers/ or
96+
In general, see http://c-cube.github.io/ocaml-containers/last/ or
9597
http://cedeela.fr/~simon/software/containers for the **API documentation**.
9698

9799
Some examples can be found link:doc/containers.adoc[there].
@@ -135,18 +137,54 @@ To build the small benchmarking suite (requires https://github.com/chris00/ocaml
135137

136138
== Contributing
137139

138-
PRs on github are welcome (patches by email too, if you prefer so).
140+
PRs on github are very welcome (patches by email too, if you prefer so).
141+
142+
[[first-time-contribute]]
143+
=== First-Time Contributors
144+
145+
Assuming your are in a clone of the repository:
146+
147+
. Some dependencies are required, you'll need
148+
`opam install benchmark qcheck qtest sequence`.
149+
. run `make devel` to enable everything (including tests).
150+
. make your changes, commit, push, and open a PR.
151+
. use `make test` without moderation! It must pass before a PR
152+
is merged. There are around 900 tests right now, and new
153+
features should come with their own tests.
139154

140-
A few guidelines:
155+
If you feel like writing new tests, that is totally worth a PR
156+
(and my gratefulness).
157+
158+
=== General Guidelines
159+
160+
A few guidelines to follow the philosophy of containers:
141161

142162
- no dependencies between basic modules (even just for signatures);
143163
- add `@since` tags for new functions;
144-
- add tests if possible (using `qtest`).
164+
- add tests if possible (using https://github.com/vincent-hugot/iTeML/[qtest]). There are numerous inline tests already,
165+
to see what it looks like search for comments starting with `(*$`
166+
in source files.
145167

146-
It is helpful to run `make devel` to enable everything. Some dependencies
147-
are required, you'll need `opam install benchmark qcheck qtest sequence`.
168+
=== For Total Beginners
148169

149-
Powered by image:http://oasis.forge.ocamlcore.org/oasis-badge.png[alt="OASIS", style="border: none;", link="http://oasis.forge.ocamlcore.org/"]
170+
Thanks for wanting to contribute!
171+
To contribute a change, here are the steps (roughly):
172+
173+
. click "fork" on https://github.com/c-cube/ocaml-containers on the top right of the page. This will create a copy of the repository on your own github account.
174+
. click the big green "clone or download" button, with "SSH". Copy the URL (which should look like `[email protected]:<your username>/ocaml-containers.git`) into a terminal to enter the command:
175+
+
176+
[source,sh]
177+
----
178+
$ git clone [email protected]:<your username>/ocaml-containers.git
179+
----
180+
+
181+
. then, `cd` into the newly created directory.
182+
. make the changes you want. See <<first-time-contribute>> for
183+
more details about what to do in particular.
184+
. use `git add` and `git commit` to commit these changes.
185+
. `git push origin master` to push the new change(s) onto your
186+
copy of the repository
187+
. on github, open a "pull request" (PR). Et voilà !
150188

151189
[[tutorial]]
152190
== Tutorial
@@ -441,3 +479,6 @@ printer:: `'a printer = Format.formatter -> 'a -> unit` is a pretty-printer
441479
=== Extended Documentation
442480

443481
See link:doc/containers.adoc[the extended documentation] for more examples.
482+
483+
Powered by image:http://oasis.forge.ocamlcore.org/oasis-badge.png[alt="OASIS", style="border: none;", link="http://oasis.forge.ocamlcore.org/"]
484+

_oasis

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
OASISFormat: 0.4
22
Name: containers
3-
Version: 1.2
3+
Version: 1.3
44
Homepage: https://github.com/c-cube/ocaml-containers
55
Authors: Simon Cruanes
66
License: BSD-2-clause
@@ -67,7 +67,7 @@ Library "containers_data"
6767
CCPersistentHashtbl, CCDeque, CCFQueue, CCBV, CCMixtbl,
6868
CCMixmap, CCRingBuffer, CCIntMap, CCPersistentArray,
6969
CCMixset, CCGraph, CCHashSet, CCBitField,
70-
CCHashTrie, CCWBTree, CCRAL,
70+
CCHashTrie, CCWBTree, CCRAL, CCSimple_queue,
7171
CCImmutArray, CCHet, CCZipper
7272
BuildDepends: bytes
7373
# BuildDepends: bytes, bisect_ppx

benchs/run_benchs.ml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,24 @@ module L = struct
2020

2121
let f_ x = x+1
2222

23+
let rec map_naive f l = match l with
24+
| [] -> []
25+
| x :: tail ->
26+
let y = f x in
27+
y :: map_naive f tail
28+
2329
let bench_map ?(time=2) n =
2430
let l = CCList.(1 -- n) in
2531
let ral = CCRAL.of_list l in
2632
let map_naive () = ignore (try List.map f_ l with Stack_overflow -> [])
33+
and map_naive2 () = ignore (try map_naive f_ l with Stack_overflow -> [])
2734
and map_tailrec () = ignore (List.rev (List.rev_map f_ l))
2835
and ccmap () = ignore (CCList.map f_ l)
2936
and ralmap () = ignore (CCRAL.map ~f:f_ ral)
3037
in
3138
B.throughputN time ~repeat
3239
[ "List.map", map_naive, ()
40+
; "List.map(inline)", map_naive2, ()
3341
; "List.rev_map o rev", map_tailrec, ()
3442
; "CCList.map", ccmap, ()
3543
; "CCRAL.map", ralmap, ()

containers.odocl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# OASIS_START
2-
# DO NOT EDIT (digest: 97e963a89adef885748c84195b76d95c)
2+
# DO NOT EDIT (digest: fe2373b07664be05f7322781403afad6)
33
src/core/CCVector
44
src/core/CCHeap
55
src/core/CCList
@@ -53,6 +53,7 @@ src/data/CCBitField
5353
src/data/CCHashTrie
5454
src/data/CCWBTree
5555
src/data/CCRAL
56+
src/data/CCSimple_queue
5657
src/data/CCImmutArray
5758
src/data/CCHet
5859
src/data/CCZipper

doc/intro.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ CCPersistentArray
9393
CCPersistentHashtbl
9494
CCRAL
9595
CCRingBuffer
96+
CCSimple_queue
9697
CCTrie
9798
CCWBTree
9899
}

myocamlbuild.ml

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
(* OASIS_START *)
2-
(* DO NOT EDIT (digest: d0913c9409d93aeda14a31d6f9ebb3b2) *)
2+
(* DO NOT EDIT (digest: 9ebeddeee0d56b1f8c98544fabcbbd9b) *)
33
module OASISGettext = struct
44
(* # 22 "src/oasis/OASISGettext.ml" *)
55

@@ -105,10 +105,7 @@ module OASISString = struct
105105
ok := false;
106106
incr str_idx
107107
done;
108-
if !what_idx = String.length what then
109-
true
110-
else
111-
false
108+
!what_idx = String.length what
112109

113110

114111
let strip_starts_with ~what str =
@@ -131,10 +128,7 @@ module OASISString = struct
131128
ok := false;
132129
decr str_idx
133130
done;
134-
if !what_idx = -1 then
135-
true
136-
else
137-
false
131+
!what_idx = -1
138132

139133

140134
let strip_ends_with ~what str =
@@ -440,7 +434,7 @@ module OASISExpr = struct
440434
end
441435

442436

443-
# 443 "myocamlbuild.ml"
437+
# 437 "myocamlbuild.ml"
444438
module BaseEnvLight = struct
445439
(* # 22 "src/base/BaseEnvLight.ml" *)
446440

@@ -520,7 +514,7 @@ module BaseEnvLight = struct
520514
end
521515

522516

523-
# 523 "myocamlbuild.ml"
517+
# 517 "myocamlbuild.ml"
524518
module MyOCamlbuildFindlib = struct
525519
(* # 22 "src/plugins/ocamlbuild/MyOCamlbuildFindlib.ml" *)
526520

@@ -881,7 +875,7 @@ module MyOCamlbuildBase = struct
881875
end
882876

883877

884-
# 884 "myocamlbuild.ml"
878+
# 878 "myocamlbuild.ml"
885879
open Ocamlbuild_plugin;;
886880
let package_default =
887881
{
@@ -921,7 +915,7 @@ let conf = {MyOCamlbuildFindlib.no_automatic_syntax = false}
921915

922916
let dispatch_default = MyOCamlbuildBase.dispatch_default conf package_default;;
923917

924-
# 925 "myocamlbuild.ml"
918+
# 919 "myocamlbuild.ml"
925919
(* OASIS_STOP *)
926920
let doc_intro = "doc/intro.txt" ;;
927921

opam

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,8 @@ available: [ocaml-version >= "4.01.0"]
4343
dev-repo: "https://github.com/c-cube/ocaml-containers.git"
4444
bug-reports: "https://github.com/c-cube/ocaml-containers/issues/"
4545
post-messages: [
46-
"Major release, with breaking changes. The APIs are more focused,
47-
more consistent, and some sub-libraries were removed or merged into the core
48-
ones.
46+
"Small release with many bugfixes and a few new functions.
4947

50-
A summary of the changes can be found at
51-
https://github.com/c-cube/ocaml-containers/issues/84
52-
and in the changelog
53-
https://github.com/c-cube/ocaml-containers/blob/1.0/CHANGELOG.adoc"
48+
A summary hub.com/c-cube/ocaml-containers/issues/84
49+
changelog: https://github.com/c-cube/ocaml-containers/blob/1.3/CHANGELOG.adoc"
5450
]

0 commit comments

Comments
 (0)