. Val-map2, c array Array.map2 f a b applies function f to all the elements of a and b, and builds an array with the results returned by f: [| f a.(0) b.(0); ...; f a.(Array.length a -1) b.(Array.length b -1)|], Raise Invalid_argument if the arrays are not the same size. Since: 4.03

. Array, > 'a array -> bool Array.for_all p [|a1; ...; an|] checks if all elements of the array satisfy the predicate p. That is, it returns, a1) && (p a2) && ... && (p an)

. Val, > 'a array -> bool Array.exists p [|a1; ...; an|] checks if at least one element of the array satisfies the predicate p. That is, it returns, a1) || (p a2) || ... || (p an)

V. Mem, array -> bool mem a l is true if and only if a is equal to an element of l

V. Memq, array -> bool Same as Array.mem[24.2], but uses physical equality instead of structural equality to compare array elements

. Array, sub a start len returns a fresh array of length len, containing the elements number start to start + len -1 of array a

V. Blit, src_pos:int -> dst:'a array -> dst_pos:int -> len:int -> unit Array.blit v1 o1 v2 o2 len copies len elements from array v1, starting at element number o1, to array v2, starting at element number o2, It works correctly even if v1 and v2 are the same array, and the source and destination chunks overlap

V. To_list, a array -> 'a list Array.to_list a returns the list of all the elements of a

V. Of_list, a list -> 'a array Array.of_list l returns a fresh array containing the elements of l

V. Iter, > 'a array -> unit Array.iter f a applies function f in turn to all the elements of a. It is equivalent to f a

V. Iteri, f:(int -> 'a -> unit) -> 'a array -> unit Same as Array.iter[24.2], but the function is applied to the index of the element as first argument, and the element itself as second argument

V. Mapi, f:(int -> 'a -> 'b) -> 'a array -> 'b array Same as Array.map[24.2], but the function is applied to the index of the element as first argument, and the element itself as second argument

V. Fold_left, > init:'a -> 'b array -> 'a Array

V. Fold_right, > 'b array -> init:'a -> 'a Array, ) ( ... (f a.(n-1) x) ...)), where n is the length of the array a

. Val-map2, c array Array.map2 f a b applies function f to all the elements of a and b, and builds an array with the results returned by f: [| f a.(0) b.(0); ...; f a.(Array.length a -1) b.(Array.length b -1)|], Raise Invalid_argument if the arrays are not the same size. Since: 4.05

V. Mem, a -> set:'a array -> bool mem x a is true if and only if x is equal to an element of a

V. Memq, a -> set:'a array -> bool Same as Array.mem[24.2], but uses physical equality instead of structural equality to compare list elements

V. Create_float, int -> float array Array.create_float n returns a fresh float array of length n, with uninitialized data. Since: 4.03 an ephemeron with two keys val create : unit -> ('k1, 'k2

. Val-unset_key1, ('k1, 'k2, 'd) t -> unit Same as Ephemeron

. Val-check_key1, ('k1, 'k2, 'd) t -> bool Same as Ephemeron

. Val-unset_key2, ('k1, 'k2, 'd) t -> unit Same as Ephemeron

. Val-check_key2, ('k1, 'k2, 'd) t -> bool Same as Ephemeron

. Val-blit_key1, b) t -> ('k1, 'c, 'd) t -> unit Same as Ephemeron

. Val-blit_key2, k2, 'b) t -> ('c, 'k2, 'd) t -> unit Same as Ephemeron

V. Unset_key, ('k, 'd) t -> int -> unit Same as Ephemeron

V. Check_key, ('k, 'd) t -> int -> bool Same as Ephemeron

V. Blit_key, a) t -> int -> ('k, 'b) t -> int -> int -> unit Same as Ephemeron

V. Blit_data, d) t -> unit Same as Ephemeron.K1.blit_data[24.11] module Make : functor (H : Hashtbl.HashedType) -> Ephemeron.S with type key = H.t array val rev

V. Init, (int -> 'a) -> 'a list List.init len f is f 0; f 1; ...; f (len-1), evaluated left to right

V. Concat, The elements of the argument are all concatenated together (in the same order) to give the result. Not tail-recursive (length of the argument + length of the longest sub-list)

. Iterators-val-iter, > 'a list -> unit List.iter f [a1; ...; an] applies function f in turn to a1; ...; an. It is equivalent to begin f a1; f a2

V. Iteri, > 'a list -> unit Same as List.iter[24.21], but the function is applied to the index of the element as first argument (counting from 0), and the element itself as second argument

. Val-map, > 'a list -> 'b list List.map f [a1; ...; an] applies function f to a1, ..., an, and builds the list [f a1

V. Mapi, > 'a list -> 'b list Same as List.map[24.21], but the function is applied to the index of the element as first argument (counting from 0), and the element itself as second argument

V. Hd, Return the first element of the given list. Raise Failure "hd" if the list is empty

. Val-compare_lengths, list -> int Compare the lengths of two lists. compare_lengths l1 l2 is equivalent to compare (length l1) (length l2), except that the computation stops after itering on the shortest list

V. Compare_length_with, len:int -> int Compare the length of a list to an integer. compare_length_with l n is equivalent to compare (length l) n, except that the computation stops after at most n iterations on the list

V. Nth, Return the n-th element of the given list. The first element (head of the list) is at position 0. Raise Failure "nth" if the list is too short

V. Nth_opt, a option Return the n-th element of the given list. The first element (head of the list) is at position 0. Return None if the list is too short. Raise Invalid_argument "List.nth" if n is negative, pp.4-05

V. Init, (int -> 'a) -> 'a list List.init len f is f 0; f 1; ...; f (len-1), evaluated left to right

. Val-rev_append, rev_append l1 l2 reverses l1 and concatenates it with l2. This is equivalent to (List.rev[24.21] l1) @ l2, but rev_append is tail-recursive and more efficient

V. Concat, The elements of the argument are all concatenated together (in the same order) to give the result. Not tail-recursive (length of the argument + length of the longest sub-list)

. Iterators-val-iter, > 'a list -> unit List.iter f [a1; ...; an] applies function f in turn to a1; ...; an. It is equivalent to begin f a1; f a2

V. Iteri, > 'a list -> unit Same as List.iter[24.21], but the function is applied to the index of the element as first argument (counting from 0), and the element itself as second argument

V. Mapi, > 'a list -> 'b list Same as List.map[24.21], but the function is applied to the index of the element as first argument (counting from 0), and the element itself as second argument

V. Rev_map, > 'a list -> 'b list List.rev_map f l gives the same result as List l), but is tail-recursive and more efficient

V. Wait, unit -> int * process_status Wait until one of the children processes die, and return its pid and termination status. On Windows: Not implemented

V. Waitpid, int -> int * process_status Same as Unix.wait[26.1], but waits for the child process whose pid is given. A pid of -1 means wait for any child. A pid of 0 means wait for any child in the same process group as the current process. Negative pid arguments represent process groups, The list of options indicates whether waitpid should return immediately without waiting, and whether it should report stopped children

. Val and . Pervasives, out_channel Same as Unix.open_process_in[26.1], but redirect the standard input of the command to a pipe. Data written to the returned output channel is sent to the standard input of the command. Warning: writes on output channels are buffered, hence be careful to call Pervasives

. Same and . Str, split[28.1], but splits into at most n substrings

V. Bounded_split_delim, regexp -> string -> int -> string list Same as Str.bounded_split[28.1], but occurrences of the delimiter at the beginning and at the end of the string are recognized and returned as empty strings in the result

V. Bounded_full_split, regexp -> string -> int -> split_result list Same as Str.bounded_split_delim[28.1], but returns the delimiters as well as the substrings contained between delimiters. The former are tagged Delim in the result list

@. Vm-level and . Threads, This implementation performs time-sharing and context switching at the level of the OCaml virtual machine (bytecode interpreter) It is available on Unix systems, and supports only bytecode programs. It cannot be used with native-code programs

. Val and . Unix, file_descr -> bytes -> int -> int -> float -> int Behave as ThreadUnix.read[29.5] and ThreadUnix.write[29.5], except that Unix_error(ETIMEDOUT,_,_) is raised if no data is available for reading or ready for writing after d seconds. The delay d is given in the fifth argument

. Val and . Unix, file_descr -> string -> int -> int -> float -> int See ThreadUnix

. Unix, . File_descr, and . Unix, file_descr list * Unix.file_descr list Pipes and redirections val pipe : ?cloexec:bool -> unit -> Unix.file_descr * Unix.file_descr val open_process_in : string -> Pervasives.in_channel val open_process_out : string -> Pervasives.out_channel val open_process : string -> Pervasives.in_channel * Pervasives.out_channel Time val sleep : int -> unit Sockets val socket : ?cloexec:bool -> Unix.socket_domain -> Unix.socket_type -> int -> Unix.file_descr val accept : ?cloexec:bool -> Unix.file_descr -> Unix.file_descr * Unix.sockaddr val connect : Unix.file_descr -> Unix.sockaddr -> unit val recv : Unix.file_descr -> bytes -> int -> int -> Unix.msg_flag list -> int val recvfrom : Unix.file_descr -> bytes -> int -> int -> Unix.msg_flag list -> int * Unix.sockaddr val send : Unix.file_descr -> bytes -> int -> int -> Unix.msg_flag list -> int val send_substring : Unix.file_descr -> string -> int -> int -> Unix.msg_flag list -> int val sendto : Unix.file_descr -> bytes -> int -> int -> Unix, msg_flag list -> Unix.sockaddr -> int val sendto_substring : Unix.file_descr -> string -> int -> int -> Unix.msg_flag list -> Unix.sockaddr -> int val open_connection : Unix.sockaddr -> Pervasives.in_channel * Pervasives.out_channel Resize and erase the graphics window

V. Rgb, int -> int -> int -> color rgb r g b returns the integer encoding the color with red component r, green component g, and blue component b. r, g and b are in the range 0

. Filling-val-fill_rect, int -> int -> int -> int -> unit fill_rect x y w h fills the rectangle with lower left corner at x,y, width w and height h, with the current color

V. Fill_poly, (int * int) array -> unit Fill the given polygon with the current color. The array contains the coordinates of the vertices of the polygon

V. Fill_arc, int -> int -> int -> int -> int -> int -> unit Fill an elliptical pie slice with the current color. The parameters are the same as for Graphics

. Val-fill_ellipse, int -> int -> int -> int -> unit Fill an ellipse with the current color. The parameters are the same as for Graphics

. Val-fill_circle, int -> int -> int -> unit Fill a circle with the current color. The parameters are the same as for Graphics

=. Type-float32_elt and . Camlinternalbigarray, float32_elt = | Float32_elt contents of the big array. Its constructors list all possible associations of OCaml types with element kinds, and are re-exported below for backward-compatibility reasons

. Val-char, As shown by the types of the values above, big arrays of kind float32_elt and float64_elt are accessed using the OCaml type float Big arrays of complex kinds complex32_elt, complex64_elt are accessed with the OCaml type Complex.t[24.9]. Big arrays of integer kinds are accessed using the smallest OCaml integer type large enough to represent the array elements: int for 8-and 16-bit integer bigarrays, as well as OCaml-integer bigarrays; int32 for 32-bit integer bigarrays; int64 for 64-bit integer bigarrays; and nativeint for platform-native integer bigarrays. Finally, big arrays of kind int8_unsigned_elt can also be accessed as arrays of characters instead of arrays of small integers

. Val-kind_size_in_bytes, b) kind -> int kind_size_in_bytes k is the number of bytes used to store an element of type k

=. Type-fortran_layout and . Camlinternalbigarray, fortran_layout = | Fortran_layout_typ To facilitate interoperability with existing C and Fortran code, this library supports two different memory layouts for big arrays, one compatible with the C conventions

V. Slice_left, Bigarray.c_layout) t -> int array -> ('a

V. Slice_right, Bigarray.fortran_layout) t -> int array -> ('a

V. Blit, c) t -> unit Copy all elements of a big array in another big array. Genarray.blit src dst copies all elements of src into dst. Both arrays src and dst must have the same number of dimensions and equal dimensions. Copying a sub-array of src to a sub-array of dst can be achieved by applying Genarray

. Val and . Unix, file_descr -> ?pos:int64 -> ('a, 'b) Bigarray.kind -> 'c Bigarray.layout -> bool -> int array -> ('a

. Val-size_in_bytes, c) t -> int size_in_bytes a is the number of elements in a multiplied by a's Bigarray

. Val-slice, c) Bigarray.Array0.t Extract a scalar (zero-dimensional slice) of the given one-dimensional big array. The integer parameter is the index of the scalar to extract. See Bigarray

V. Blit, c) t -> ('a, 'b, 'c) t -> unit Copy the first big array to the second big array

. Val-dim1, c) t -> int Return the first dimension of the given two-dimensional big array

. Val-dim2, c) t -> int Return the second dimension of the given two-dimensional big array

. Val-size_in_bytes, c) t -> int size_in_bytes a is the number of elements in a multiplied by a's Bigarray

V. Sub_left, Bigarray.c_layout) t -> int -> int -> ('a

. Val-size_in_bytes, c) t -> int size_in_bytes a is the number of elements in a multiplied by a's Bigarray

. Val, c) t -> int -> int -> int -> 'a -> unit Array3.set a x y v, or alternatively a.{x,y,z} <-v, stores the value v at coordinates (x, y, z) in a. x, y and z must be within the bounds of a

V. Sub_left, Bigarray.c_layout) t -> int -> int -> ('a

V. Sub_right, Bigarray.fortran_layout) t -> int -> int -> ('a

. Val-slice_left_1, Bigarray.c_layout) t -> int -> int -> ('a, 'b, Bigarray.c_layout) Bigarray.Array1.t val map_file : Unix.file_descr -> ?pos:int64 -> ('a, 'b) Bigarray.kind -> 'c Bigarray.layout -> bool -> int -> int -> int ->

V. Unsafe_set, c) t -> int -> int -> int -> 'a -> unit Like Bigarray.Array3.set[32.1], but bounds checking is not always performed. end Three-dimensional arrays. The Array3 structure provides operations similar to those of Bigarray

. Val-genarray_of_array1, c) Array1.t -> ('a, 'b, 'c) Genarray.t Return the generic big array corresponding to the given one-dimensional big array

. Val-genarray_of_array2, c) Array2.t -> ('a, 'b, 'c) Genarray.t Return the generic big array corresponding to the given two-dimensional big array

. Val-genarray_of_array3, c) Array3.t -> ('a, 'b, 'c) Genarray.t Return the generic big array corresponding to the given three-dimensional big array

. Val-reshape_0, c) Genarray.t -> ('a, 'b, 'c) Array0.t Specialized version of Bigarray.reshape[32.1] for reshaping to zero-dimensional arrays

. Val-reshape_1, c) Genarray.t -> int -> ('a, 'b, 'c) Array1.t Specialized version of Bigarray

. Val-reshape_2, c) Genarray.t -> int -> int -> ('a, 'b, 'c) Array2.t Specialized version of Bigarray

. Val-reshape_3, c) Genarray.t -> int -> int -> int -> ('a, 'b, 'c) Array3.t Specialized version of Bigarray