append Elimination
lWhen maximum
efficiency is desired, uses of append should be
avoided.
lIt is often possible to get rid of append by defining versions of functions with an extra accumulator argument.
lExample:
nodes(Graph) =
remove_duplicates(append(map(first,
Graph), map(second,
Graph)));
lShow how to avoid
append by generalizing map to take an
accumulator.