Library
Module
Module type
Parameter
Class
Class type
Range module provide a type for handling the description of an integer sequence described by a start value and a stop value. This module provide functions to fold this range, and some basic set operation likes cross and join.
The main goal is to provide a split capacity in order to make life easy for distributed processing.
val from : int -> int -> t
from int_value -> int_value will create a t value representing the range described by the two values given in parameter.
filter on predicate function attach a predicate that will modify the behaviour of iter or fold funtions in order to apply only to values that satisfies the predicate.
val filtered_from : int -> int -> (int -> bool) -> t
create a new range of integer with a filter
Application of f is delayed. Filters and map functions can be stacked.
val is_natural : t -> bool
is filtered predicate
test if a Range.t value contain a filter or map function transforming data.
val fold : ('a -> int -> 'a) -> 'a -> t -> 'a
fold the equivalent of List.fold_left applied to integer range_record explore all the values contained in the rang value applying f to the accumulator and the current element read by fold. If a filter was associated to the range value, only element validated by the predicate f will be passed to the function.
val iter : (int -> unit) -> t -> unit
iter apply a function with side effect on all values of the range. This function support filtering.
split a range value into a list of smaller range, useful for batching in parallel processing.
val contain : int -> t -> bool
contain function to test if an integer value is contained in a Range.t values
new Range.t value representing the common value between two Range.t values.
apply f to elements contained in a Range.t value
This feature used a delayed application of f. Like for filters, f is stacked on previous filter or map functions.
agregate the limits of a range through a function.
val to_string : t -> string
export limits of a range to a string.
The presence of functions that can modifiy the content is signaled by "M:" prefix