common/mlstdutils: Drop our implementations of functions now in OCaml 4.01.

We reimplemented some functions which can now be found in the OCaml
stdlib since 4.01 (or earlier).  The functions I have dropped are:

 - String.map
 - |>
 - iteri  (replaced by List.iteri)
 - mapi   (replaced by List.mapi)

Note that our definition of iteri was slightly wrong: the type of the
function parameter was too wide, allowing (int -> 'a -> 'b) instead of
(int -> 'a -> unit).

I also added this new function to the Std_utils.String module as an
export from stdlib String:

 - String.iteri

Thanks: Pino Toscano
This commit is contained in:
Richard W.M. Jones
2017-10-05 10:07:11 +01:00
parent a702858664
commit 457bdb4e2f
26 changed files with 39 additions and 73 deletions

View File

@@ -1165,7 +1165,7 @@ $VG guestfish \\
let vg_count = ref 0 in
iteri (
List.iteri (
fun i (name, _, _, _) ->
let params = [name] in
let params =