generic sequence pretty-printing function