scala collections - A (strictly) `Growable` mutable `Seq` -
i need (mutable) seq only growable. not need update index or shrink collection or transform (or other form of mutation), grow (+=) , want actively protect collection other mutations.
- the problem
buffers notgrowableshrinkable, cantransformed. - (mutable.)
seqnotshrinkablecan transform , notgrowable
to (cursory) understanding of scala collection, there no concrete implementation has exact traits i'm looking believe have implement own?
edit:
i tried val hands : collection.seq[team] growable[team] = mutable.seq[team]() in attempt make nominal type conform requirements, actively preventing client call undesired mutating methods on hands says types not conform.
i think looking
val hands : collection.seq[team] growable[team] = mutable.buffer[team]()
Comments
Post a Comment