A Vector[Vector[Char]]
would probably be a good bet. It is an IndexedSeq
so has decent update / prepend / update performance, unlike the List
you mention. If you look at Performance Characteristics, it's the only immutable collection mentioned that has effective constant-time update.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…