            "{ 1 2 3 }"
 } ;
 
-{ trim-left trim-right trim } related-words
+HELP: trim-slice
+{ $values
+     { "seq" sequence } { "quot" quotation }
+     { "slice" slice } }
+{ $description "Removes elements starting from the left and right sides of a sequence if they match a predicate. Once an element does not match, the test stops and the rest of the sequence is left on the stack as a slice." }
+{ $example "" "USING: prettyprint math sequences ;"
+           "{ 0 0 1 2 3 0 0 } [ zero? ] trim-slice ."
+           "T{ slice { from 2 } { to 5 } { seq { 0 0 1 2 3 0 0 } } }"
+} ;
+
+{ trim trim-slice trim-left trim-left-slice trim-right trim-right-slice } related-words
+
+HELP: sift
+{ $values
+     { "seq" sequence }
+     { "newseq" sequence } }
+ { $description "Outputs a new sequence with all instance of " { $link f  } " removed." }
+ { $examples 
+    { $example "USING: prettyprint sequences ;"
+        "{ \"a\" 3 { } f } sift ."
+        "{ \"a\" 3 { } }"
+    }
+} ;
+
+HELP: harvest
+{ $values
+     { "seq" sequence }
+     { "newseq" sequence } }
+{ $description "Outputs a new sequence with all empty sequences removed." }
+{ $examples 
+    { $example "USING: prettyprint sequences ;"
+               "{ { } { 2 3 } { 5 } { } } harvest ."
+               "{ { 2 3 } { 5 } }"
+    }
+} ;
+
+{ filter sift harvest } related-words
+
+HELP: set-first
+{ $values
+     { "first" object } { "seq" sequence } }
+{ $description "Sets the first element of a sequence." }
+{ $examples 
+    { $example "USING: prettyprint kernel sequences ;"
+        "{ 1 2 3 4  } 5 over set-first ."
+        "{ 5 2 3 4 }"
+    }
+} ;
+
+HELP: set-second
+{ $values
+     { "second" object } { "seq" sequence } }
+{ $description "Sets the second element of a sequence." }
+{ $examples 
+    { $example "USING: prettyprint kernel sequences ;"
+        "{ 1 2 3 4  } 5 over set-second ."
+        "{ 1 5 3 4 }"
+    }
+} ;
+
+HELP: set-third
+{ $values
+     { "third" object } { "seq" sequence } }
+{ $description "Sets the third element of a sequence." }
+{ $examples 
+    { $example "USING: prettyprint kernel sequences ;"
+        "{ 1 2 3 4  } 5 over set-third ."
+        "{ 1 2 5 4 }"
+    }
+} ;
+
+HELP: set-fourth
+{ $values
+     { "fourth" object } { "seq" sequence } }
+{ $description "Sets the fourth element of a sequence." }
+{ $examples 
+    { $example "USING: prettyprint kernel sequences ;"
+        "{ 1 2 3 4  } 5 over set-fourth ."
+        "{ 1 2 3 5 }"
+    }
+} ;
+
+{ set-first set-second set-third set-fourth } related-words
+
+HELP: replicate
+{ $values
+     { "seq" sequence } { "quot" quotation }
+     { "newseq" sequence } }
+{ $description "Calls the quotation for every element of the sequence in order. However, the element is not passed to the quotation -- it is dropped, and the quotation produces an element of its own that is collected into a sequence of the same class as the input sequence." }
+{ $examples 
+    { $unchecked-example "USING: prettyprint kernel sequences ;"
+        "5 [ 100 random ] replicate ."
+        "{ 52 10 45 81 30 }"
+    }
+} ;
+
+HELP: replicate-as
+{ $values
+     { "seq" sequence } { "quot" quotation } { "exemplar" sequence }
+     { "newseq" sequence } }
+{ $description "Calls the quotation for every element of the sequence in order. However, the element is not passed to the quotation -- it is dropped, and the quotation produces an element of its own that is collected into a sequence of the same class as the exemplar sequence." }
+{ $examples 
+    { $unchecked-example "USING: prettyprint kernel sequences ;"
+        "5 [ 100 random ] B{ } replicate-as ."
+        "B{ 44 8 2 33 18 }"
+    }
+} ;
+{ replicate replicate-as } related-words
+
+HELP: partition
+{ $values
+     { "seq" sequence } { "quot" quotation }
+     { "trueseq" sequence } { "falseseq" sequence } }
+     { $description "Calls a predicate quotation on each element of the input sequence.  If the test yields true, the element is added to " { $snippet "trueseq" } "; if false, it's added to " { $snippet "falseseq" } "." }
+{ $examples 
+    { $example "USING: prettyprint kernel math sequences ;"
+        "{ 1 2 3 4 5 } [ even? ] partition [ . ] bi@"
+        "{ 2 4 }\n{ 1 3 5 }"
+    }
+} ;


ARTICLE: "sequences-appending" "Appending sequences"
{ $subsection append }
{ $subsection 3append }
{ $subsection concat }
{ $subsection join }

           "{ 1 2 3 0 0 }"
} ;

HELP: trim-left-slice
{ $values
     { "seq" sequence } { "quot" quotation }
     { "slice" slice } }
{ $description "Removes elements starting from the left side of a sequence if they match a predicate. Once an element does not match, the test stops and the rest of the sequence is left on the stack as a slice" }
{ $example "" "USING: prettyprint math sequences ;"
           "{ 0 0 1 2 3 0 0 } [ zero? ] trim-left-slice ."
           "T{ slice { from 2 } { to 7 } { seq { 0 0 1 2 3 0 0 } } }"
} ;

HELP: trim-right
{ $values
     { "seq" sequence } { "quot" quotation }
