Page
Library
Module
Module type
Parameter
Class
Class type
Source
Tezt.BaseSourceBase functions.
Same as Filename.concat.
Same as Lwt.bind.
Same as Lwt.both.
Same as Lwt.both, but immediately propagate exceptions.
More precisely, if one of the two promises is rejected or canceled, cancel the other promise and reject the resulting promise immediately with the original exception.
Same as Lwt.return.
Same as Lwt.return_unit.
Same as Lwt.return_none.
Same as Lwt.return_some.
Get the value of an option that must not be None.
Usage: mandatory name option
name is used in the error message if option is None.
Make a list of all integers between two integers.
If the first argument is greater than the second argument, return the empty list.
Backport of List.find_map from OCaml 4.10.
take n l returns the first n elements of l if longer than n, else l itself.
drop n l removes the first n elements of l if longer than n, else the empty list. Raise invalid_arg if n is negative.
Compiled regular expressions.
Compile a regular expression using Perl syntax.
Test whether a string matches a regular expression.
Example: "number 1234 matches" =~ rex "\\d+"
Match a regular expression with two capture groups.
Match a regular expression with three capture groups.
Match a regular expression with four capture groups.
Match a regular expression with one capture group and return all results.
val replace_string :
?pos:int ->
?len:int ->
?all:bool ->
rex ->
by:string ->
string ->
stringreplace_string ~all rex ~by s iterates on s, and replaces every occurrence of rex with by. If all = false, then only the first occurrence of rex is replaced.
Repeat something a given amount of times.
Fold n times a given function.
Open file, use function to write output then close the output. In case of error while writing, the channel is closed before raising the exception
Open file, use function to read input then close the input. In case of error while reading, the channel is closed before raising the exception *
Write a string into a file, overwriting the file if it already exists.
Usage: write_file filename ~contents
Read the whole contents of a file.