pack(v) {[(a, bool)] [a] :: (a in any)}
Given a sequence of (value,flag) pairs, pack packs
all the values with a t in their corresponding
flag into consecutive elements, deleting elements with an f.
v1 ++ v2 {([a], [a]) [a] :: (a in any)}
Given two sequences, ++ appends them.
For example:
4pt
subseq(v, start, end) {([a], int, int) [a] :: (a in any)}
Given a sequence, subseq returns the subsequence starting at
position start and ending one before position end.
For example:
4pt
drop(v, n) {([a], int) [a] :: (a in any)}
Given a sequence, drop drops the first n items
from the sequence.
For example:
4pt
take(v, n) {([a], int) [a] :: (a in any)}
Given a sequence, take takes the first n items
from the sequence.
For example:
4pt
odd_elts(v) {[a] [a] :: (a in any)}
Returns the odd indexed elements of a sequence.
even_elts(v) {[a] [a] :: (a in any)}
Returns the even indexed elements of a sequence.
interleave(a, b) {([a], [a]) [a] :: (a in any)}
Interleaves the elements of two sequences. The sequences must
be of the same length.
For example:
4pt
length_from_flags(flags) {[bool] [int]}
Given a sequence of boolean flags, this will return the length
from each true flag to the next. A true flag is always assumed in
the first position.