Add append function which handles append(xs, []) efficiently.