mapMaybei f xs maps a function expecting an index (the position in the list * xs that it is currently viewing) and producing a maybe type across a list. * Elements that produce Nothing under f are discarded in the output, whilst * those producing Just e for some e are kept.
val mapMaybei : (Nat_big_num.num->'a->'b option)->'a list->'b list
partitionii is xs returns a pair of lists: firstly those elements in xs that are at indices in is, and secondly the remaining elements. It preserves the order of elements in xs.
split_string_on_char s c splits a string s into a list of substrings * on character c, otherwise returning the singleton list containing s * if c is not found in s. * * NOTE: quirkily, this doesn't discard separators (e.g. because NUL characters * are significant when indexing into string tables). FIXME: given this, is this * function really reusable? I suspect not.
val string_contains : string ->string -> bool
string_of_nat m produces a string representation of natural number m.
string_suffix i s returns all but the first i characters of s. * Fails if the index is negative, or beyond the end of the string.
val padding_and_maybe_newline : char ->Nat_big_num.num->string -> string
padding_and_maybe_newline c w s creates enough of char c to pad string s to w characters, * unless s is of length w - 1 or greater, in which case it generates w copies preceded by a newline. * This style of formatting is used by the GNU linker in its link map output, so we * reproduce it using this function. Note that string s does not appear in the * output.
val space_padding_and_maybe_newline : Nat_big_num.num->string -> string
space_padding_and_maybe_newline w s creates enoughspaces to pad string s to w characters, * unless s is of length w - 1 or greater, in which case it generates w copies preceded by a newline. * This style of formatting is used by the GNU linker in its link map output, so we * reproduce it using this function. Note that string s does not appear in the * output.
val padded_and_maybe_newline : char ->Nat_big_num.num->string -> string
padded_and_maybe_newline w s pads string s to w characters, using char c * unless s is of length w - 1 or greater, in which case the padding consists of * w copies of c preceded by a newline. * This style of formatting is used by the GNU linker in its link map output, so we * reproduce it using this function.
padding_to c w s creates enough copies of c to pad string s to w characters, * or 0 characters if s is of length w or greater. Note that string s does not appear in the * output.
val left_padded_to : char ->Nat_big_num.num->string -> string
left_padded_to c w s left-pads string s to w characters using c, * returning it unchanged if s is of length w or greater.
val right_padded_to : char ->Nat_big_num.num->string -> string
right_padded_to c w s right-pads string s to w characters using c, * returning it unchanged if s is of length w or greater.
val space_padded_and_maybe_newline : Nat_big_num.num->string -> string
space_padded_and_maybe_newline w s pads string s to w characters, using spaces, * unless s is of length w - 1 or greater, in which case the padding consists of * w spaces preceded by a newline. * This style of formatting is used by the GNU linker in its link map output, so we * reproduce it using this function.
val left_space_padded_to : Nat_big_num.num->string -> string
left_space_padded_to w s left-pads string s to w characters using spaces, * returning it unchanged if s is of length w or greater.
val right_space_padded_to : Nat_big_num.num->string -> string
right_space_padded_to w s right-pads string s to w characters using spaces, * returning it unchanged if s is of length w or greater.