Module Higher_order


module Higher_order: sig .. end
Provides higher-order functions.

val unary_of_int_add : int -> int -> int
Returns the function that adds x and an integer, given the integer x
val unary_of_real_mult : float -> float -> float
Returns the function that multiplies x and a real number, given the real number x
val unary_of_string_concat : string -> string -> string
Returns the function that concatenates x before a string, given the string x
val log_in_base : float -> float -> float
Returns the logarithm in base a function given a positive real number a other than 1.
val curry : ('a * 'b -> 'c) -> 'a -> 'b -> 'c
Currying a function with two arguments.
val unary_of_int_add_1 : int -> int -> int
The same function as unary_of_int_add.
val unary_of_real_mult_1 : float -> float -> float
The same function as unary_of_real_mult.
val unary_of_string_concat_1 : string -> string -> string
The same function as unary_of_string_concat.
val uncurry : ('a -> 'b -> 'c) -> 'a * 'b -> 'c
Uncurrying the curried version of a function with two arguments.
val compose : ('a -> 'b) * ('c -> 'a) -> 'c -> 'b
Function composition : returns teh function g of f, given a pair (g, f) of functions.
val map_twice : int list -> int list
Returns the list of twice each element in a list of integers.
val map_length : 'a list list -> int list
Returns the list of the lengths of the elements in a list of lists.
val map_to_all : ('a -> 'b) -> 'a list -> 'b list
Applying map_to_all (f) to an empty list returns an empty list, while applying it to a list a1 ... an returns the list f (a1) ... f (an).
val map_to_all_1 : ('a -> 'b) -> 'a list -> 'b list
The same function as map_to_all.
val map_twice_1 : int list -> int list
The same function as map_twice.
val map_twice_2 : int list -> int list
The same function as map_twice, too.
val map_length_1 : 'a list list -> int list
The same function as map_length.
val sum_int_list : int list -> int
Summation of all the integers in a list.
val prod_float_list : float list -> float
Product of all the reals in a list.
val and_list : bool list -> bool
Logical conjunction of all the booleans in a list.
val accumul_right : ('a * 'b -> 'b) * 'b -> 'a list -> 'b
Applying accumul_right (op, neutral) to an empty list returns neutral, while applying it to a list a1 ... an returns op (a1, op (a2, op (..., op (an, neutral)))).
val accumul_right_1 : ('a * 'b -> 'b) * 'b -> 'a list -> 'b
The same function as accumul_right.
val sum_int_list_1 : int list -> int
The same function as sum_int_list.
val sum_int_list_2 : int list -> int
The same function as sum_int_list, too
val prod_float_list_1 : int list -> int
The same function as prod_float_list.
val prod_float_list_2 : float list -> float
The same function as prod_float_list, too
val and_list_1 : int list -> int
The same function as and_list.
val and_list_2 : bool list -> bool
The same function as and_list, too.
val concatenate_strings : string list -> string
Returns the function that computes the concatenation of all the strings in a list.
val concatenate_strings_1 : string list -> string
The same function as concatenate_strings.
val compose_functions : ('a -> 'a) list -> 'a -> 'a
Returns the function that computes the composition of all the functions in a list.
val concatenate_lists : 'a list list -> 'a list
Returns the function that computes the concatenation of all the lists in a list.
val sum : ('a -> float) * ('a -> float) -> 'a -> float
Computes the sum of two functions from real numbers to real numbers.
val product : ('a -> float) * ('a -> float) -> 'a -> float
Computes the product of two functions from real numbers to real numbers.
val phi : ('a * 'b -> 'c) -> ('d -> 'a) * ('d -> 'b) -> 'd -> 'c
A higher-order function to compute the function that computes the sum of two functions from real numbers to real numbers, the function that computes the product of two functions from real numbers to real numbers, and so on
val sum_1 : (float -> float) * (float -> float) -> float -> float
val product_1 : (float -> float) * (float -> float) -> float -> float
val sublist : ('a -> bool) -> 'a list -> 'a list
Computes from a given predicate the function that extracts the sublist of the elements in a list satisfying the predicate.
val positive_only : int list -> int list
Returns the sublist of the positive integers in a list.
val deriv : (float -> float) -> float -> float
Returns the (approximate) derivative function of a function that maps real numbers to real numbers).
val newton : (float -> float) * float * float -> float
Returns the unique zero a function (that maps real numbers to real numbers) has in a interval.
val approx_square_root_of_two : float
Returns an approximat value for the square root of 2.