Skip to content

Commit

Permalink
prepare for 2.7
Browse files Browse the repository at this point in the history
remove mdx
  • Loading branch information
c-cube committed Nov 12, 2019
1 parent 2241a25 commit 7cefde4
Show file tree
Hide file tree
Showing 24 changed files with 74 additions and 56 deletions.
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# Changelog

## 2.7

- deprecate CCKList in favor of the standard Seq
- CCIO: add `_gen` suffixes to some functions
- ccsexp: provide ability to annotate parsed S-exprs with their position
- ccsexp: functorize the parser/printer
- ccsexp: support `#;` for commenting a sexp
- fix: remove dep from vec to list
- add `to_string` to many modules (#270)
- add `CCDeque.{remove_*;update_*}`,` CCDeque.{*_opt}`
- add `CCDeque.{filter,filter_map}`
- add `CCDeque.filter_in_place`
- add `CCBool.{to,of}_int`
- add `Result.flatten_l` to turn a list of results into a result of list
- refactor: remove stdlib's code, simple reimplementation of `Stdlib.Fun`
- add `CCArray.Infix`
- Document behaviour of `Fun.finally` when finaliser raises

- travis: test on OCaml 4.09, too.
- more docs for IO

## 2.6.1

bugfix release:
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# OCaml-containers 📦
# OCaml-containers 📦 [![Build Status](https://travis-ci.org/c-cube/ocaml-containers.svg?branch=master)](https://travis-ci.org/c-cube/ocaml-containers)

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

Expand All @@ -12,8 +12,6 @@ map/fold_right/append, and additional functions on lists).
Alternatively, `open Containers` will bring enhanced versions of the standard
modules into scope.

[![Build Status](https://travis-ci.org/c-cube/ocaml-containers.svg?branch=master)](https://travis-ci.org/c-cube/ocaml-containers)

## Quick Summary

Containers is:
Expand Down
3 changes: 1 addition & 2 deletions containers.opam
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
opam-version: "2.0"
name: "containers"
version: "2.6.1"
version: "2.7"
author: "Simon Cruanes"
maintainer: "simon.cruanes.2007@m4x.org"
synopsis: "A modular, clean and powerful extension of the OCaml standard library"
Expand All @@ -19,7 +19,6 @@ depends: [
"iter" { with-test }
"gen" { with-test }
"uutf" { with-test }
"mdx" { with-test }
"odoc" { with-doc }
"ocaml" { >= "4.02.0" }
]
Expand Down
14 changes: 7 additions & 7 deletions doc/dune
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

(alias
(name runtest)
(deps containers.md)
(action (progn
(run mdx test %{deps})
(diff? %{deps} %{deps}.corrected))))

;(alias
; (name runtest)
; (deps containers.md)
; (action (progn
; (run mdx test %{deps})
; (diff? %{deps} %{deps}.corrected))))
;
12 changes: 6 additions & 6 deletions dune
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

(alias
(name runtest)
(deps README.md)
(action (progn
(run mdx test %{deps})
(diff? %{deps} %{deps}.corrected))))
;(alias
; (name runtest)
; (deps README.md)
; (action (progn
; (run mdx test %{deps})
; (diff? %{deps} %{deps}.corrected))))

2 changes: 1 addition & 1 deletion qtest/dune
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
(modes native)
(modules run_qtest)
; disable some warnings in qtests
(flags :standard -warn-error -a -w -33-35-27-39 -nolabels)
(flags :standard -warn-error -a -w -3-33-35-27-39 -nolabels)
(libraries iter gen qcheck containers containers.unix
containers.data containers.thread containers.iter
containers.sexp uutf)
Expand Down
2 changes: 1 addition & 1 deletion src/core/CCArray.mli
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ val random_choose : 'a t -> 'a random_gen
val to_string : ?sep:string -> ('a -> string) -> 'a array -> string
(** [to_string ~sep item_to_string a] print [a] to a string using [sep] as a separator
between elements of [a].
@since NEXT_RELEASE *)
@since 2.7 *)

val to_seq : 'a t -> 'a sequence
(** [to_seq a] returns a [sequence] of the elements of an array [a].
Expand Down
2 changes: 1 addition & 1 deletion src/core/CCArrayLabels.mli
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ val random_choose : 'a t -> 'a random_gen
val to_string : ?sep:string -> ('a -> string) -> 'a array -> string
(** [to_string ~sep item_to_string a] print [a] to a string using [sep] as a separator
between elements of [a].
@since NEXT_RELEASE *)
@since 2.7 *)

val to_seq : 'a t -> 'a sequence
(** [to_seq a] returns a [sequence] of the elements of an array [a].
Expand Down
4 changes: 2 additions & 2 deletions src/core/CCBool.mli
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ val equal : t -> t -> bool

val to_int : t -> int
(** [to_int true = 1], [to_int false = 0].
@since NEXT_RELEASE *)
@since 2.7 *)

val of_int : int -> t
(** [of_int i] is the same as [i <> 0]
@since NEXT_RELEASE *)
@since 2.7 *)

val negate : t -> t
(** Negation on booleans (functional version of [not]).
Expand Down
2 changes: 1 addition & 1 deletion src/core/CCChar.mli
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ val to_int : t -> int

val to_string : t -> string
(** [to_string c] return a string containing [c]
@since NEXT_RELEASE *)
@since 2.7 *)

val pp_buf : Buffer.t -> t -> unit
(** Renamed from [pp] since 2.0. *)
Expand Down
2 changes: 1 addition & 1 deletion src/core/CCHeap.ml
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ module type S = sig

val to_string : ?sep:string -> (elt -> string) -> t -> string
(** Print the heap in a string
@since NEXT_RELEASE *)
@since 2.7 *)

val pp : ?sep:string -> elt printer -> t printer
(** @since 0.16
Expand Down
2 changes: 1 addition & 1 deletion src/core/CCHeap.mli
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ module type S = sig

val to_string : ?sep:string -> (elt -> string) -> t -> string
(** Print the heap in a string
@since NEXT_RELEASE *)
@since 2.7 *)

val pp : ?sep:string -> elt printer -> t printer
(** Printer.
Expand Down
2 changes: 1 addition & 1 deletion src/core/CCList.mli
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ val to_string : ?start:string -> ?stop:string -> ?sep:string ->
('a -> string) -> 'a t -> string
(** [to_string ~start ~stop ~sep item_to_string l] print [l] to a string using
[sep] as a separator between elements of [l].
@since NEXT_RELEASE *)
@since 2.7 *)

val to_seq : 'a t -> 'a sequence
(** Return a [sequence] of the elements of the list. *)
Expand Down
2 changes: 1 addition & 1 deletion src/core/CCListLabels.mli
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ val to_string : ?start:string -> ?stop:string -> ?sep:string ->
('a -> string) -> 'a t -> string
(** [to_string ~start ~stop ~sep item_to_string l] print [l] to a string using
[sep] as a separator between elements of [l].
@since NEXT_RELEASE *)
@since 2.7 *)

val to_seq : 'a t -> 'a sequence
(** Return a [sequence] of the elements of the list. *)
Expand Down
2 changes: 1 addition & 1 deletion src/core/CCPair.mli
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ val compare : ('a -> 'a -> int) -> ('b -> 'b -> int) -> ('a * 'b) -> ('a * 'b) -

val to_string : ?sep:string -> ('a -> string) -> ('b -> string) -> ('a * 'b) -> string
(** Print tuple in a string
@since NEXT_RELEASE *)
@since 2.7 *)

type 'a printer = Format.formatter -> 'a -> unit

Expand Down
2 changes: 1 addition & 1 deletion src/core/CCResult.mli
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ end
val flatten_l : ('a, 'err) t list -> ('a list, 'err) t
(** Same as [map_l id]: returns [Ok [x1;…;xn]] if [l=[Ok x1; …; Ok xn]],
or the first error otherwise.
@since NEXT_RELEASE
@since 2.7
*)

val map_l : ('a -> ('b, 'err) t) -> 'a list -> ('b list, 'err) t
Expand Down
2 changes: 1 addition & 1 deletion src/core/CCSet.ml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ module type S = sig
?start:string -> ?stop:string -> ?sep:string ->
(elt -> string) -> t -> string
(** Print the set in a string
@since NEXT_RELEASE *)
@since 2.7 *)

val pp :
?start:string -> ?stop:string -> ?sep:string ->
Expand Down
2 changes: 1 addition & 1 deletion src/core/CCSet.mli
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ module type S = sig
?start:string -> ?stop:string -> ?sep:string ->
(elt -> string) -> t -> string
(** Print the set in a string
@since NEXT_RELEASE *)
@since 2.7 *)

val pp :
?start:string -> ?stop:string -> ?sep:string ->
Expand Down
2 changes: 1 addition & 1 deletion src/core/CCVector.mli
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ val to_string :
?start:string -> ?stop:string -> ?sep:string ->
('a -> string) -> ('a,_) t -> string
(** Print the vector in a string
@since NEXT_RELEASE *)
@since 2.7 *)

val pp : ?start:string -> ?stop:string -> ?sep:string ->
'a printer -> ('a,_) t printer
22 changes: 11 additions & 11 deletions src/data/CCDeque.mli
Original file line number Diff line number Diff line change
Expand Up @@ -47,50 +47,50 @@ val peek_front : 'a t -> 'a

val peek_front_opt : 'a t -> 'a option
(** First value.
@since NEXT_RELEASE *)
@since 2.7 *)

val peek_back : 'a t -> 'a
(** Last value.
@raise Empty if empty. *)

val peek_back_opt : 'a t -> 'a option
(** Last value.
@since NEXT_RELEASE *)
@since 2.7 *)

val remove_back : 'a t -> unit
(** Remove last value. If the deque is empty do nothing
@since NEXT_RELEASE *)
@since 2.7 *)

val remove_front : 'a t -> unit
(** Remove first value. If the deque is empty do nothing
@since NEXT_RELEASE *)
@since 2.7 *)

val take_back : 'a t -> 'a
(** Take last value.
@raise Empty if empty. *)

val take_back_opt : 'a t -> 'a option
(** Take last value.
@since NEXT_RELEASE *)
@since 2.7 *)

val take_front : 'a t -> 'a
(** Take first value.
@raise Empty if empty. *)

val take_front_opt : 'a t -> 'a option
(** Take first value.
@since NEXT_RELEASE *)
@since 2.7 *)

val update_back : 'a t -> ('a -> 'a option) -> unit
(** Update last value. If the deque is empty do nothing.
If the function returns [None], remove last element;
if it returns [Some x], replace last element with [x].
@since NEXT_RELEASE *)
@since 2.7 *)

val update_front : 'a t -> ('a -> 'a option) -> unit
(** Update first value. If the deque is empty do nothing.
Similar to {!update_back} but for the first value.
@since NEXT_RELEASE *)
@since 2.7 *)

val append_front : into:'a t -> 'a t -> unit
(** [append_front ~into q] adds all elements of [q] at the front
Expand Down Expand Up @@ -160,15 +160,15 @@ val to_rev_list : 'a t -> 'a list

val filter : ('a -> bool) -> 'a t -> 'a t
(** Filter into a new copy.
@since NEXT_RELEASE *)
@since 2.7 *)

val filter_map : ('a -> 'b option) -> 'a t -> 'b t
(** Filter map into a new copy
@since NEXT_RELEASE *)
@since 2.7 *)

val filter_in_place : 'a t -> ('a -> bool) -> unit
(** Keep only elements that satisfy the predicate.
@since NEXT_RELEASE *)
@since 2.7 *)

(** {2 print} *)

Expand Down
2 changes: 1 addition & 1 deletion src/iter/CCKList.mli
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
(** {1 Continuation List}
@deprecated since NEXT_RELEASE, you should use the standard {b Seq} instead.
@deprecated since 2.7, you should use the standard {b Seq} instead.
See {{: https://github.com/c-cube/oseq/} oseq} for similar combinators.
*)
Expand Down
12 changes: 6 additions & 6 deletions src/sexp/CCSexp.ml
Original file line number Diff line number Diff line change
Expand Up @@ -320,12 +320,12 @@ include (Make(struct
CCResult.to_opt (parse_string "\"\123\bcoucou\"") <> None
*)

(*$= & ~printer:(function Ok x -> to_string x | Error e -> "error " ^ e)
(parse_string "(a b)") (Ok (`List [`Atom "a"; `Atom "b"]))
(parse_string "(a\n ;coucou\n b)") (Ok (`List [`Atom "a"; `Atom "b"]))
(parse_string "(a #; (foo bar\n (1 2 3)) b)") (Ok (`List [`Atom "a"; `Atom "b"]))
(parse_string "#; (a b) (c d)") (Ok (`List [`Atom "c"; `Atom "d"]))
(parse_string "#; (a b) 1") (Ok (`Atom "1"))
(*$= & ~printer:(function Result.Ok x -> to_string x | Result.Error e -> "error " ^ e)
(parse_string "(a b)") (Result.Ok (`List [`Atom "a"; `Atom "b"]))
(parse_string "(a\n ;coucou\n b)") (Result.Ok (`List [`Atom "a"; `Atom "b"]))
(parse_string "(a #; (foo bar\n (1 2 3)) b)") (Result.Ok (`List [`Atom "a"; `Atom "b"]))
(parse_string "#; (a b) (c d)") (Result.Ok (`List [`Atom "c"; `Atom "d"]))
(parse_string "#; (a b) 1") (Result.Ok (`Atom "1"))
*)


Expand Down
6 changes: 3 additions & 3 deletions src/sexp/CCSexp.mli
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ type 'a gen = unit -> 'a option

(** {2 Abstract representation of S-expressions}
@since NEXT_RELEASE *)
@since 2.7 *)
module type SEXP = CCSexp_intf.SEXP

(** {2 Operations over S-expressions}
@since NEXT_RELEASE *)
@since 2.7 *)
module type S = CCSexp_intf.S

(** {2 Functorized operations}
This builds a parser and printer for S-expressions represented as
in the [Sexp] argument.
@since NEXT_RELEASE *)
@since 2.7 *)
module Make(Sexp : SEXP) : S with type t = Sexp.t

(** {2 Basics} *)
Expand Down
4 changes: 2 additions & 2 deletions src/sexp/CCSexp_intf.ml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ type 'a gen = unit -> 'a option

(** {2 Abstract representation of S-expressions}
@since NEXT_RELEASE *)
@since 2.7 *)
module type SEXP = sig
type t
type loc
Expand All @@ -25,7 +25,7 @@ end

(** {2 Operations over S-expressions}
@since NEXT_RELEASE *)
@since 2.7 *)
module type S = sig
type t
type sexp = t
Expand Down

0 comments on commit 7cefde4

Please sign in to comment.