[WIP] [RFC] pastel add ability to partition by a list of indices #188
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added the ability to partition by a list of indices. E.g. partitioning by [i1, i2, i3] will split a string into up to 4 substrings consisting of the ranges from (0 - i1), (i1 - i2) (i2 -i3), (i3 - endOfString).
What remains is
a) Naming the function (currently just partition2 as a placeholder)
b) Figuring out what preconditions we want to have on the indices (and how to handle nonsense input, the behavior for partitioning a single string can be found in the test cases for that function, but don't generalize super well)
b) Test some boundary conditions (slightly blocked by point b)