Tutorial by Examples

List.map has the signature ('a -> 'b) -> 'a list -> 'b list which in English is a function that takes a function (we'll call this the mapping function) from one type (namely 'a) to another type (namely 'b) and a list of the first type. The function returns a list of the second type where ev...
The List.fold_left and List.fold_right functions are higher-order functions that implement the outer logic of list aggregation. Aggregating a list, sometimes also referred to as reducing a list, means computing a value derived from the sequential inspection of all items in that list. The documenta...

Page 1 of 1