package acgtk
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha512=07f391d052090bb70c10ec511fdc53af764954cbe1c30093778984c5ed41a4327573fdac0890c6fd619ff9827725572eb7b8a7545bd8ccb7f5bddb84d2d7f7cc
doc/acgtk.utilsLib/UtilsLib/Utils/index.html
Module UtilsLib.UtilsSource
This module provides some useful modules or functions
StringMap is module for maps from strings to type 'a
string_of_list sep to_string [a_1;...;a_n] returns a string made of the strings to_string a_1 ... to_string a_n concatenated with the separator sep between each of the elements (if the list is of length greater than 2)
intersperse sep [a_1;...;a_n] returns a list where elements of the input list are interspersed with sep as in a_1; sep; a_2; sep; ...; sep; a_n.
cycle n xs returns the first n elements of the infinite list formed by cyclically repeating the elements of xs. Returns the empty list if xs is empty.
fold_left1 plus elems sums up the elements in elems using plus. A generalization of List.fold_left from monoids to semigroups, where we don't have any neutral element. Assumes elems is non-empty.
string_of_list_rev sep to_string [a_1;...;a_n] returns a string made of the strings to_string a_n ... to_string a_1 concatenated with the separator sep between each of the elements (if the list is of length greater than 2)
find_file f dirs tries to find a file with the name f in the directories listed in dirs. If it finds it in dir, it returns the full name Filename.concat dir f. To check in the current directory, add "" to the list. It tries in the directories of dirs in this order and stops when it finds such a file. If it can't find any such file, raise the exception No_file(f,msg) where msg contains a string describing where the file f was looked for.
f >> g is the function composition (f >> g) x = f (g x)
decompose ~input:i ~base:b returns the decomposition of i in the base b as a list of integers (between 0 and b).