package conex
Install
    
    dune-project
 Dependency
Authors
Maintainers
Sources
sha256=8ba730718cbf0a381f0bce3493d18bfea1823bee0f43e4cbddad222b66dc164f
    
    
  sha512=a76787c46b7c867e41daba10989841e95e7a2ba142dd09ae078649fd60340fcef703f41ddffc67b9c899fb4a2956906a0c8f9d04db7da435ac502b19851a490a
    
    
  doc/conex/Conex_utils/index.html
Module Conex_utilsSource
String, unsigned integers, logging, collections, and more
Sets, Maps, List utils
filter_map f xs is xs', a list which contains all elements where f resulted in Some _.
Format
'a fmt is the signature for pretty printers.
pp_list pp is a pretty printer for a list (surrounded by square brackets, elements are separated by semicolon). The pp is be a pretty printer for list elements.
str_pp pp a results in a string applying the pretty-printer to the value.
Result combinators
guard pred err is either Ok () (if pred holds), Error err otherwise.
foldM f a xs applies f to each element of xs, returns either Ok and the produced value, or Error.
iterM f xs applies f to each element of xs, returns either Ok and the produced value, or Error.
foldS f a s applies f to each element of the set s, returns either Ok and the produced value, or Error.
err_to_str pp res is either Ok a or Error str where str was produced by str_pp.
String
Some String utilities implemented here to avoid external dependencies. This is a subset of Astring.
Unsigned integers
64 bit unsigned integer with explicit overflow behaviour (see Uint.succ).
Logging
LOGS is a subset of the Logs library, providing four log streams.
File system types
The sum type of possible file types we expect
A path is a list of strings
path_to_string path is String.concat "/" path.
string_to_path str is String.cuts "/" str and ensuring no empty segments, ".", or ".." be present. If str contains a leading "/", it is discarded.
string_to_path_exb str is String.cuts "/" str and ensuring no empty segments, ".", or ".." be present. If str contains a leading "/", it is discarded.
subpath ~parent p is true if p starts with all segments of parent.
strip_prefix ~prefix p strips the prefix from p (only if subpath ~paren:prefix p is true). Returns None otherwise.
Tree
Tree is a simple tree datatype, edge is a string, values are 'a lists.
timestamp_to_int64 timestamp attempts to convert the provided RFC 3339 timestamp to an int64 representing the seconds since Unix epoch (1970-01-01). When decoding leads to an error, or the timestamp is not in range (of the int64), an error message is returned.