prepare 0.11

This commit is contained in:
Simon Cruanes 2015-05-24 17:22:20 +02:00
parent 7e5161f94f
commit 8f33484dff
10 changed files with 48 additions and 24 deletions

View file

@ -1,5 +1,29 @@
# Changelog # Changelog
## 0.11
- add `CCList.{remove,is_empty}`
- add `CCOpt.is_none`
- remove packs for `containers_string` and `containers_advanced`
- add `Containers_string.Parse`, very simple monadic parser combinators
- remove warning from `.merlin`
- attempts of bugfix in PrintBox for unicode text (wip)
- add `CCList.{find_pred,find_pred_exn}`
- bugfix in `CCUnix.escape_str`
- add methods and accessors to `CCUnix`
- in `CCUnix`, use `Unix.environment` as the default environment
- add `CCList.partition_map`
- `RingBuffer.{of_array, to_array}` convenience functions
- `containers.misc.RAL`: more efficient in memory (unfold list)
- add `CCInt.pow` (thanks to bernardofpc)
- add `CCList.group_succ`
- `containers.data.CCMixset`, set of values indexed by poly keys
- disable warning 32 (unused val) in .merlin
- some infix operators for `CCUnix`
- add `CCUnix.async_call` for spawning and communicating with subprocess
- add `CCList.Set.{add,remove}`
- fix doc of `CCstring.Split.list_`
## 0.10 ## 0.10
- add `containers.misc.Puf.iter` - add `containers.misc.Puf.iter`

2
_oasis
View file

@ -1,6 +1,6 @@
OASISFormat: 0.4 OASISFormat: 0.4
Name: containers Name: containers
Version: 0.10 Version: 0.11
Homepage: https://github.com/c-cube/ocaml-containers Homepage: https://github.com/c-cube/ocaml-containers
Authors: Simon Cruanes Authors: Simon Cruanes
License: BSD-2-clause License: BSD-2-clause

View file

@ -44,7 +44,7 @@ val neg : t -> t
val pow : t -> t -> t val pow : t -> t -> t
(** [pow a b = a^b] for positive integers [a] and [b]. (** [pow a b = a^b] for positive integers [a] and [b].
raises [Invalid_argument] if [a = b = 0] or [b] < 0. raises [Invalid_argument] if [a = b = 0] or [b] < 0.
@since NEXT_RELEASE *) @since 0.11 *)
type 'a printer = Buffer.t -> 'a -> unit type 'a printer = Buffer.t -> 'a -> unit
type 'a formatter = Format.formatter -> 'a -> unit type 'a formatter = Format.formatter -> 'a -> unit

View file

@ -32,7 +32,7 @@ val empty : 'a t
val is_empty : _ t -> bool val is_empty : _ t -> bool
(** [is_empty l] returns [true] iff [l = []] (** [is_empty l] returns [true] iff [l = []]
@since NEXT_RELEASE *) @since 0.11 *)
val map : ('a -> 'b) -> 'a t -> 'b t val map : ('a -> 'b) -> 'a t -> 'b t
(** Safe version of map *) (** Safe version of map *)
@ -87,7 +87,7 @@ val partition_map : ('a -> [<`Left of 'b | `Right of 'c | `Drop]) ->
- if [f x = `Left y], adds [y] to the first list - if [f x = `Left y], adds [y] to the first list
- if [f x = `Right z], adds [z] to the second list - if [f x = `Right z], adds [z] to the second list
- if [f x = `Drop], ignores [x] - if [f x = `Drop], ignores [x]
@since NEXT_RELEASE *) @since 0.11 *)
val pure : 'a -> 'a t val pure : 'a -> 'a t
@ -116,25 +116,25 @@ val last : int -> 'a t -> 'a t
val find_pred : ('a -> bool) -> 'a t -> 'a option val find_pred : ('a -> bool) -> 'a t -> 'a option
(** [find_pred p l] finds the first element of [l] that satisfies [p], (** [find_pred p l] finds the first element of [l] that satisfies [p],
or returns [None] if no element satisfies [p] or returns [None] if no element satisfies [p]
@since NEXT_RELEASE *) @since 0.11 *)
val find_pred_exn : ('a -> bool) -> 'a t -> 'a val find_pred_exn : ('a -> bool) -> 'a t -> 'a
(** Unsafe version of {!find_pred} (** Unsafe version of {!find_pred}
@raise Not_found if no such element is found @raise Not_found if no such element is found
@since NEXT_RELEASE *) @since 0.11 *)
val find_map : ('a -> 'b option) -> 'a t -> 'b option val find_map : ('a -> 'b option) -> 'a t -> 'b option
(** [find f l] traverses [l], applying [f] to each element. If for (** [find f l] traverses [l], applying [f] to each element. If for
some element [x], [f x = Some y], then [Some y] is returned. Otherwise some element [x], [f x = Some y], then [Some y] is returned. Otherwise
the call returns [None] the call returns [None]
@since NEXT_RELEASE *) @since 0.11 *)
val find : ('a -> 'b option) -> 'a list -> 'b option val find : ('a -> 'b option) -> 'a list -> 'b option
(** @deprecated in favor of {!find_map}, for the name is too confusing *) (** @deprecated in favor of {!find_map}, for the name is too confusing *)
val find_mapi : (int -> 'a -> 'b option) -> 'a t -> 'b option val find_mapi : (int -> 'a -> 'b option) -> 'a t -> 'b option
(** Like {!find_map}, but also pass the index to the predicate function. (** Like {!find_map}, but also pass the index to the predicate function.
@since NEXT_RELEASE *) @since 0.11 *)
val findi : (int -> 'a -> 'b option) -> 'a t -> 'b option val findi : (int -> 'a -> 'b option) -> 'a t -> 'b option
(** @deprecated in favor of {!find_mapi}, name is too confusing (** @deprecated in favor of {!find_mapi}, name is too confusing
@ -147,7 +147,7 @@ val find_idx : ('a -> bool) -> 'a t -> (int * 'a) option
val remove : ?eq:('a -> 'a -> bool) -> x:'a -> 'a t -> 'a t val remove : ?eq:('a -> 'a -> bool) -> x:'a -> 'a t -> 'a t
(** [remove ~x l] removes every instance of [x] from [l]. Tailrec. (** [remove ~x l] removes every instance of [x] from [l]. Tailrec.
@param eq equality function @param eq equality function
@since NEXT_RELEASE *) @since 0.11 *)
val filter_map : ('a -> 'b option) -> 'a t -> 'b t val filter_map : ('a -> 'b option) -> 'a t -> 'b t
(** Map and remove elements at the same time *) (** Map and remove elements at the same time *)
@ -173,7 +173,7 @@ val uniq_succ : ?eq:('a -> 'a -> bool) -> 'a list -> 'a list
val group_succ : ?eq:('a -> 'a -> bool) -> 'a list -> 'a list list val group_succ : ?eq:('a -> 'a -> bool) -> 'a list -> 'a list list
(** [group_succ ~eq l] groups together consecutive elements that are equal (** [group_succ ~eq l] groups together consecutive elements that are equal
according to [eq] according to [eq]
@since NEXT_RELEASE *) @since 0.11 *)
(** {2 Indices} *) (** {2 Indices} *)
@ -209,11 +209,11 @@ end
module Set : sig module Set : sig
val add : ?eq:('a -> 'a -> bool) -> 'a -> 'a t -> 'a t val add : ?eq:('a -> 'a -> bool) -> 'a -> 'a t -> 'a t
(** [add x set] adds [x] to [set] if it was not already present (** [add x set] adds [x] to [set] if it was not already present
@since NEXT_RELEASE *) @since 0.11 *)
val remove : ?eq:('a -> 'a -> bool) -> 'a -> 'a t -> 'a t val remove : ?eq:('a -> 'a -> bool) -> 'a -> 'a t -> 'a t
(** [remove x set] removes one occurrence of [x] from [set] (** [remove x set] removes one occurrence of [x] from [set]
@since NEXT_RELEASE *) @since 0.11 *)
val mem : ?eq:('a -> 'a -> bool) -> 'a -> 'a t -> bool val mem : ?eq:('a -> 'a -> bool) -> 'a -> 'a t -> bool
(** membership to the list *) (** membership to the list *)

View file

@ -37,7 +37,7 @@ val maybe : ('a -> 'b) -> 'b -> 'a t -> 'b
val is_some : _ t -> bool val is_some : _ t -> bool
val is_none : _ t -> bool val is_none : _ t -> bool
(** @since NEXT_RELEASE *) (** @since 0.11 *)
val compare : ('a -> 'a -> int) -> 'a t -> 'a t -> int val compare : ('a -> 'a -> int) -> 'a t -> 'a t -> int

View file

@ -42,7 +42,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
() ()
]} ]}
@since NEXT_RELEASE *) @since 0.11 *)
type t type t
(** A set of values of heterogeneous types *) (** A set of values of heterogeneous types *)

View file

@ -200,7 +200,7 @@ module type S = sig
val to_array : t -> Array.t val to_array : t -> Array.t
(** Create an array from the elements, in order. (** Create an array from the elements, in order.
@since NEXT_RELEASE *) @since 0.11 *)
end end
module MakeFromArray(Array:Array.S) = struct module MakeFromArray(Array:Array.S) = struct

View file

@ -199,7 +199,7 @@ module type S = sig
val to_array : t -> Array.t val to_array : t -> Array.t
(** Create an array from the elements, in order. (** Create an array from the elements, in order.
@since NEXT_RELEASE *) @since 0.11 *)
end end
(** An efficient byte based ring buffer *) (** An efficient byte based ring buffer *)

View file

@ -59,7 +59,7 @@ let p = U.list ~sep:"," U.word;;
parse_string_exn "[abc , de, hello ,world ]" p;; parse_string_exn "[abc , de, hello ,world ]" p;;
]} ]}
@since NEXT_RELEASE @since 0.11
*) *)
type 'a or_error = [`Ok of 'a | `Error of string] type 'a or_error = [`Ok of 'a | `Error of string]

View file

@ -82,13 +82,13 @@ type async_call_result =
close_in:unit; (* close stdin *) close_in:unit; (* close stdin *)
close_err:unit; close_err:unit;
close_out:unit; close_out:unit;
close_all:unit; (* close all 3 channels *) (** @since NEXT_RELEASE *) close_all:unit; (* close all 3 channels *) (** @since 0.11 *)
wait:Unix.process_status; (* block until the process ends *) wait:Unix.process_status; (* block until the process ends *)
wait_errcode:int; (* block until the process ends, then extract errcode *) wait_errcode:int; (* block until the process ends, then extract errcode *)
(** @since NEXT_RELEASE *) (** @since 0.11 *)
> >
(** A subprocess for interactive usage (read/write channels line by line) (** A subprocess for interactive usage (read/write channels line by line)
@since NEXT_RELEASE *) @since 0.11 *)
val async_call : ?env:string array -> val async_call : ?env:string array ->
('a, Buffer.t, unit, async_call_result) format4 -> ('a, Buffer.t, unit, async_call_result) format4 ->
@ -97,11 +97,11 @@ val async_call : ?env:string array ->
line generators and line sinks (for stdin). line generators and line sinks (for stdin).
if [p] is [async_call "cmd"], then [p#wait] waits for the subprocess if [p] is [async_call "cmd"], then [p#wait] waits for the subprocess
to die. Channels can be closed independently. to die. Channels can be closed independently.
@since NEXT_RELEASE *) @since 0.11 *)
(** {2 Accessors} (** {2 Accessors}
@since NEXT_RELEASE *) @since 0.11 *)
val stdout : < stdout : 'a; .. > -> 'a val stdout : < stdout : 'a; .. > -> 'a
val stderr : < stderr : 'a; .. > -> 'a val stderr : < stderr : 'a; .. > -> 'a
@ -113,11 +113,11 @@ val errcode : < errcode : 'a; .. > -> 'a
module Infix : sig module Infix : sig
val (?|) : ('a, Buffer.t, unit, call_result) format4 -> 'a val (?|) : ('a, Buffer.t, unit, call_result) format4 -> 'a
(** Infix version of {!call} (** Infix version of {!call}
@since NEXT_RELEASE *) @since 0.11 *)
val (?|&) : ('a, Buffer.t, unit, async_call_result) format4 -> 'a val (?|&) : ('a, Buffer.t, unit, async_call_result) format4 -> 'a
(** Infix version of {!async_call} (** Infix version of {!async_call}
@since NEXT_RELEASE *) @since 0.11 *)
end end
include module type of Infix include module type of Infix