- Signatures and types
- Index and length information
- Getting and setting
- Creation of resizable arrays
- Strategy handling
- Copying, blitting and range extraction
- Combining resizable arrays
- Adding and removing elements
- Swapping
- Array conversions
- List conversions
- Iterators
- Scanning of resizable arrays
- Searching of resizable arrays
- UNSAFE STUFF - USE WITH CAUTION!
package res
Module Res.BitsSource
Resizable bit vector using the default reallocation strategy.
Signatures and types
Module implementing the reallocation strategy
Type of reallocation strategy
Type of resizable arrays
Type of the elements in the resizable array
Index and length information
Getting and setting
Creation of resizable arrays
Strategy handling
set_strategy ra s sets the reallocation strategy of resizable array ra to s, possibly causing an immediate reallocation.
put_strategy ra s sets the reallocation strategy of resizable array ra to s. Reallocation is only done at later changes in size.
enforce_strategy ra forces a reallocation if necessary (e.g. after a put_strategy).
Copying, blitting and range extraction
fill ra ofs len el fills resizable array ra from offset ofs with len elements el, possibly adding elements at the end. Raises Invalid_argument if offset ofs is larger than the length of the array.
blit ra1 ofs1 ra2 ofs2 len blits resizable array ra1 onto ra2 reading len elements from offset ofs1 and writing them to ofs2, possibly adding elements at the end of ra2. Raises Invalid_argument if ofs1 and len do not designate a valid subarray of ra1 or if ofs2 is larger than the length of ra2.
Combining resizable arrays
Adding and removing elements
add_one ra el adds element el to resizable array ra, possibly causing a reallocation.
remove_one ra removes the last element of resizable array ra, possibly causing a reallocation.
remove_n ra n removes the last n elements of resizable array ra, possibly causing a reallocation.
remove_range ra ofs len removes len elements from resizable array ra starting at ofs and possibly causing a reallocation.
clear ra removes all elements from resizable array ra, possibly causing a reallocation.
Swapping
swap_in_last ra n swaps the last element with the one at position n.
Array conversions
sof_array s ar converts a standard array to a resizable one, using strategy s.
of_array ar converts a standard array to a resizable one using the default strategy.
List conversions
sof_list s l creates a resizable array using strategy s and the elements in list l.
of_list l creates a resizable array using the default strategy and the elements in list l.
Iterators
iter f ra applies the unit-function f to each element in resizable array ra.
iteri f ra applies the unit-function f to each index and element in resizable array ra.
fold_left f a ra left-folds values in resizable array ra using function f and start accumulator a.
fold_right f a ra right-folds values in resizable array ra using function f and start accumulator a.
Scanning of resizable arrays
Searching of resizable arrays
filter_in_place p ra as filter, but filters in place.
UNSAFE STUFF - USE WITH CAUTION!
- Signatures and types
- Index and length information
- Getting and setting
- Creation of resizable arrays
- Strategy handling
- Copying, blitting and range extraction
- Combining resizable arrays
- Adding and removing elements
- Swapping
- Array conversions
- List conversions
- Iterators
- Scanning of resizable arrays
- Searching of resizable arrays
- UNSAFE STUFF - USE WITH CAUTION!