package lambdapi
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=221dff97ab245c49b7e6480fa2a3a331ab70eb86dd5d521e2c73151029bbb787
sha512=a39961bb7f04f739660a98a52981d4793709619cd21310ca6982ba78af81ef09e01c7517ee3b8b2687b09f7d2614d878c1d69494ca6ab8ef8205d240c216ce8a
doc/lambdapi.lplib/Lplib/Extra/index.html
Module Lplib.Extra
Source
get_safe_prefix p strings
returns a string starting with p
and so that there is no non-negative integer k
such that p ^ string_of_int k
belongs to strings
.
time f x
times the application of f
to x
, and returns the evaluation time in seconds together with the result of the application.
Exception raised by the with_timeout
function on a timeout.
with_timeout nbs f x
computes f x
with a timeout of nbs
seconds. The exception Timeout
is raised if the computation takes too long, otherwise everything goes the usual way.
input_lines ic
reads the input channel ic
line by line and returns its contents. The trailing newlines are removed in lines. The input channel is not closed by the function.
run_process cmd
runs the command cmd
and returns the list of the lines that it printed to its standard output (if the command was successful). If the command failed somehow, then None
is returned.
file_time fname
returns the modification time of file fname
represented as a float
. neg_infinity
is returned if the file does not exist.
more_recent source target
checks whether the target
(produced from the source
file) should be produced again. This is the case when source
is more recent than target
.
files f d
returns all the filenames in d
and its sub-directories recursively satisfying the function f
, assuming that d
is a directory.