ocaml/opam-repository — pull request #2062 by bmillwood (2014-05-13 10:48:26+00:00)
Title: core 111.13.00-rc1

## New package: patience_diff

- Moved `Patience_diff` out of `Core_extended` into its own library depending only on `Core_kernel`.

## async_extra

- For `Typed_tcp.create`, added a `Client_id.t` argument to the `auth`
callback.

## async_unix

- Added `Scheduler.yield_every`, which returns a function that calls `Scheduler.yield` every n-th call.

This is useful in circumstances where you don't have strict control over where a deferred is examined, as in a `Deferred.List.iter`.

## bignum

- Eliminated the dependence of `Bignum` on `Re2`, and reduced dependence from `Core` to `Core_kernel`.
- Extended the rounding interface to bring it in line with int and float rounding.
- Improved the performance of `Bignum`'s binprot.

`Bignum`'s binprot had been to just binprot the decimal string representation. This is both slow to do and unnecessarily big in the majority of cases. Did something better in the majority of cases and fell back to this representation in the exceptional case.

$ ./inline_benchmarks_runner
Estimated testing time 20s (2 benchmarks x 10s). Change using -quota SECS.
┌──────────────────────────────────────────────────────┬──────────┬───────────┬────────────┐
│ Name │ Time/Run │ mWd/Run │ Percentage │
├──────────────────────────────────────────────────────┼──────────┼───────────┼────────────┤
│ bignum0.ml:Stable:Bignum binprot roundtrip compact │ 7.87us │ 490.00w │ 32.88% │
│ bignum0.ml:Stable:Bignum binprot roundtrip classic │ 23.94us │ 1_079.00w │ 100.00% │
└──────────────────────────────────────────────────────┴──────────┴───────────┴────────────┘

## core_extended

- Moved `Patience_diff` out of `Core_extended` into its own library.

## core_kernel

- Added a `Sequence` module that implements polymorphic, on-demand sequences.

Also implemented conversion to `Sequence.t` from various containers.

- Improved the explicitness and expressiveness of `Binary_searchable.binary_search`.

`binary_search` now takes an additional (polymorphic variant) argument describing the relationship of the returned position to the element being searched for.

val binary_search
: ?pos:int
-> ?len:int
-> t
-> compare:(elt -> elt -> int)
-> [ `Last_strictly_less_than (** {v | < elt X | v} *)
| `Last_less_than_or_equal_to (** {v | <= elt X | v} *)
| `Last_equal_to (** {v | = elt X | v} *)
| `First_equal_to (** {v | X = elt | v} *)
| `First_greater_than_or_equal_to (** {v | X >= elt | v} *)
| `First_strictly_greater_than (** {v | X > elt | v} *)
]
-> elt
-> int option

- Added a new function, `Binary_searchable.binary_search_segmented`, that can search an array consisting of two segments, rather than ordered by `compare`.

(** [binary_search_segmented ?pos ?len t ~segment_of which] takes an [segment_of]
function that divides [t] into two (possibly empty) segments:

{v
| segment_of elt = `Left | segment_of elt = `Right |
v}

[binary_search_segmented] returns the index of the element on the boundary of the
segments as specified by [which]: [`Last_on_left] yields the index of the last
element of the left segment, while [`First_on_right] yields the index of the first
element of the right segment. It returns [None] if the segment is empty.

By default, [binary_search] searches the entire [t]. One can supply [?pos] or
[?len] to search a slice of [t].

[binary_search_segmented] does not check that [segment_of] segments [t] as in the
diagram, and behavior is unspecified if [segment_of] doesn't segment [t]. Behavior
is also unspecified if [segment_of] mutates [t]. *)
val binary_search_segmented
: ?pos:int
-> ?len:int
-> t
-> segment_of:(elt -> [ `Left | `Right ])
-> [ `Last_on_left | `First_on_right ]
-> int option

- Made `Queue` match `Binary_searchable.S1`.
- Made `Gc.Stat` and `Gc.Control` match `Comparable`.
- Fixed some unit tests in `Type_immediacy` that were fragile due to GC.

## sexplib

- In `Sexplib.Std`, renamed `Macro` as `Sexp_macro`.

## type_conv

- Removed some unused-value warnings when `with` is used in signatures.

Removed warnings in cases like:

include (module_expr : sig type t with bin_io end)