Improve API on Array#replace, Hash#replace