ex-2.33: map,append,length implemented by accumulate