OCamlPro/opam-repository — pull request #1094 by ysulsky (2013-09-13 15:16:23+00:00)
Title: Core 109.42.00

# 109.41.00

## Async_parallel

- Renamed `Parallel` as `Async_parallel`.

## Async_unix

- Changed `Reader` to treat more `errno` responses to a `read()` system call as `EOF` rather than raise.

The following are now treated as `EOF`.

```
ENETDOWN
ENETRESET
ENETUNREACH
ETIMEDOUT
```

- Improved the error message that async prints when the thread pool is stuck, including the time of the error.

## Bin_prot

- Remove all uses of "unwrapped" pointers

Unwrapped pointers cannot coexist with the remove-page-table
optimization.

Removed all the C stubs for reading/writing and used instead either
the new primitives of the next OCaml or standard OCaml code
reading/writing integers byte by byte.

Since we don't have unsafe/safe functions anymore but only safe ones,
removed all the `bin_{read,write}_t_` functions.

Also renamed `bin_read_t__` to `__bin_read_t__` for the same reason as
sexplib: to avoid confusion with the function generated for `t_` and
hide it in the toplevel.

## Core_kernel

- Added `Map.of_alist_reduce`.

This function is a natural addition alongside `of_alist_fold`. Its
advantage is that it does not require an `init` argument like
`of_alist_fold`. Moreover, it does not involve `option` types, like
`List.reduce` does in order to handle the empty list case.

## Core

- Added `Command.Spec.map_anon` and `map_flag`.

```ocaml
(** [map_flag flag ~f] transforms the parsed result of [flag] by applying [f] *)
val map_flag : 'a flag -> f:('a -> 'b) -> 'b flag

(** [map_anons anons ~f] transforms the parsed result of [anons] by applying [f] *)
val map_anons : 'a anons -> f:('a -> 'b) -> 'b anons
```

- Fixed `Unix.open_flag` to compile with OCaml 4.01.

It needed the additional constructor `O_CLOEXEC`.

## Core_bench

- Columns that have a `+` prefix are now always displayed, whereas
columns that don't are displayed only if they have meaningful data.

- Added the ability to reload saved metrics (benchmark test data) so
that bench can re-analyze them.

## Ocaml_plugin

- Added option `-strict-sequence`, which is set to `true` by default.

## Type_conv

- Fixed the generated code of `typerep` and `sexplib` on sum types containing `True` or `False`.

Without this fix, `typerep` would wrong constructor names for
`Blang.t`, for instance.

`Variantslib` has the same problem but applying the same fix there
would still not make the generated code compile because the generated
code would contain labels and variable named `true` or `false`.

Other syntax extensions should not be affected because they don't
build strings from constructor names.

# 109.42.00

## Bin_prot

- Backed out the changes introduced in 109.41

## Core

- Removed `Zone` from `Core.Std`; use `Time.Zone` instead.

- Removed `Time.Date`; use `Date` instead.

- Improved the performance of `Piecewise_linear` by using arrays with binary search on indices.

The previous implementation `Piecewise_linear` used `(float * float)
list` (a list of (x,y) pairs) to represent piecewise linear functions,
with a linear search through the knots to evaluate the function at a
point. This type is now:

```ocaml
{ x : float array
; y : float array
}
```

and the implementation uses binary search to identify the correct array index.

Here are the costs of the `get` function under the old (list) and new (array)
implementations for various numbers of knots:

```
knots | old | new
------+------+-----
1 | 11ns| 12ns
2 | 18ns| 14ns
5 | 27ns| 19ns
100 | 182ns| 38ns
1000 |1974ns| 52ns
```

- Added module `Time.Ofday.Zoned`, which is a pair of an `Time.Ofday.t` and a `Time.Zone.t`.

- Added `with compare` to `Time.Zone.Stable.t`.

- Added `Timing_wheel` functionality.

* Added `Config` module, which combines `alarm_precision` and `timing_wheel_level_bits`.
* Removed the need to supply a dummy value to `create`.
* Added `mem` and `clear` functions.
* Added functions for dealing with the interval number: `interval_num`, `now_interval_num`, `interval_num_start`, `add_at_interval_num`.

This makes it easier to use a timing wheel with `int` interval
numbers, which are more efficient than than `float` times.

## Core_kernel

- Added `Array.is_sorted_strictly` and `List.is_sorted_strictly`.

```ocaml
val is_sorted_strictly : 'a t -> cmp:('a -> 'a -> int) -> bool
```

- Added `Array.find_consecutive_duplicate` and `List.find_consecutive_duplicate`.

```ocaml
val find_consecutive_duplicate : 'a t -> equal:('a -> 'a -> bool) -> ('a * 'a) option
```

- Added `Array.truncate`, which changes (shortens) the length of an array.

```ocaml
val truncate : _ t -> len:int -> unit
```

- Improved the debugging message in `Bounded_int_table.remove` to show the data structure's details.

- Added `Float.iround_lbound` and `iround_ubound`, the bounds for rounding to `int`.

- Added `Hashtbl.similar`, which is like `equal`, but allows the types of the values in the two tables to differ.

- Added `Pool.Pointer.phys_compare`, which is analagous to `phys_equal`, and does not require an argument comparison function.

```ocaml
val phys_compare : 'a t -> 'a t -> int
```
- Exposed that `Pool.Debug`'s output types are the same as its input types.

- Added the build system (`omake` or `jenga`) to `Version_util.build_info`.

Also exposed it as `Verion_util.build_system : string`.

## Async_core

- In `ASYNC_CONFIG`, replaced `alarm_precision` and `timing_wheel_level_bits` with `timing_wheel_config`.

This parallels the new `Timing_wheel.Config` module.

## Async_unix

- Added `Reader.drain`.

```ocaml
val drain : t -> unit Deferred.t
```

- Added `Writer.with_close`.

```ocaml
val with_close : t -> f:(unit -> 'a Deferred.t) -> 'a Deferred.t
```

## Async_extra

- Fixed `Log.Blocking` so that when async is running it writes the message in syslog before failing with an exception.