Vocabularysplitting.
monotonicInputsOutputspieces | a sequence of sequences |
Word descriptionSplits a sequence into subsequences, in which for all consecutive pairs of elements the quotation returns true.
ExamplesUSING: splitting.monotonic math prettyprint ;
{ 1 2 3 2 3 4 } [ < ] monotonic-split .
{ { 1 2 3 } { 2 3 4 } }
USING: splitting.monotonic math prettyprint ;
{ 1 2 3 2 1 0 } [ < ] monotonic-split .
{ { 1 2 3 } { 2 } { 1 } { 0 } }
See alsomonotonic-split-sliceDefinition