Bytes
Functions
O(1). A byte array with a single element.
O(n). Pack a list of bytes.
O(n). Unpack to a list.
O(n). Replicate a byte n times.
O(n). Generate bytes using a function.
O(1). Length in bytes.
O(1). Test if empty.
O(1). Index a byte (unsafe).
O(1). Safe indexing.
O(1). First byte (unsafe on empty).
O(1). All but the first byte (view).
O(1). Last byte (unsafe on empty).
O(1). All but the last byte (view).
O(1). Take first n bytes (view).
O(1). Drop first n bytes (view).
O(1). Split at position (views).
O(1). Slice from start to end indices (view).
O(n). Take while predicate holds.
O(n). Drop while predicate holds.
O(n). Split at first element not satisfying predicate.
O(n). Split at first element satisfying predicate.
O(n). Append two byte arrays.
O(n). Concatenate a list of byte arrays.
O(n). Intercalate a separator.
O(n). Test membership.
O(n). Test non-membership.
O(n). Find first element satisfying predicate.
O(n). Find index of first element satisfying predicate.
O(n). Find all indices of elements satisfying predicate.
O(n). Find index of element.
O(n). Find all indices of element.
O(n). Map a function over bytes.
O(n). Reverse byte order.
O(n). Intersperse a byte between elements.
O(n*m). Transpose rows and columns.
O(n). Left fold.
O(n). Strict left fold.
O(n). Right fold.
O(n). Left fold without starting value.
O(n). Right fold without starting value.
O(n). Test if all elements satisfy predicate.
O(n). Test if any element satisfies predicate.
O(n). Maximum element.
O(n). Minimum element.
O(n). Sum of elements.
O(n). Scan left.
O(n). Scan right.
O(n). Build from unfolding function.
O(n). Zip two byte arrays.
O(n). Zip with function.
O(n). Unzip pairs.
O(n). Copy to pinned memory.
O(1). Convert pinned to regular (view).
Execute action with pointer to pinned data.
Get raw pointer (unsafe, caller manages lifetime).
O(n). Allocate new mutable byte array.
O(1). Read byte at index.
O(1). Write byte at index.
O(1). Modify byte at index.
O(n). Freeze mutable to immutable.
O(n). Thaw immutable to mutable.
O(n). Copy bytes between mutable arrays.
O(n). Convert to list.
O(n). Convert from list.
O(1). Convert lazy to strict.
O(1). Convert strict to lazy.
Encode Text to UTF-8 bytes.
Decode UTF-8 bytes to Text (unsafe on invalid).
Decode UTF-8 with error handling.
Encode to Base64.
Decode from Base64.
Read entire file as bytes.
Write bytes to file.
Append bytes to file.
Read n bytes from handle.
Write bytes to handle.
Read line from handle.
Read all remaining contents.