A strawman architecture for new collections.
A strawman architecture for new collections.
A strawman architecture for new collections. It contains some example collection classes and methods with the intent to expose some key issues. It would be good to compare this to other implementations of the same functionality, to get an idea of the strengths and weaknesses of different collection architectures.
For a test file, see tests/run/CollectionTests.scala.
Strawman4 is like strawman1, but built over views instead of by-name iterators
A strawman architecture for new collections.
A strawman architecture for new collections. It contains some example collection classes and methods with the intent to expose some key issues. It would be good to compare this to other implementations of the same functionality, to get an idea of the strengths and weaknesses of different collection architectures.
For a test file, see tests/run/CollectionTests.scala.
Strawman5 is like strawman4, but using inheritance through ...Like traits instead of decorators.
Advantage: Much easier to specialize. See partition for strict (buildable) collections or drop for Lists.
Disadvantage: More "weird" types in base traits; some awkwardness with
A strawman architecture for new collections.
A strawman architecture for new collections. It contains some example collection classes and methods with the intent to expose some key issues. It would be good to compare this to odether implementations of the same functionality, to get an idea of the strengths and weaknesses of different collection architectures.
For a test file, see tests/run/CollectionTests.scala.
Strawman6 is like strawman5, and adds lazy lists (i.e. lazie streams), arrays and some utilitity methods (take, tail, mkString, toArray). Also, systematically uses builders for all strict collections.
Types covered in this strawman:
IterableOnce, Iterable, Seq, LinearSeq, View, IndexedView
2. Collection creator base types:
FromIterable, IterableFactory, Buildable, Builder
3. Types that bundle operations:
IterableOps, IterableMonoTransforms, IterablePolyTransforms, IterableLike SeqMonoTransforms, SeqLike
4. Concrete collection types:
List, LazyList, ListBuffer, ArrayBuffer, ArrayBufferView, StringView, ArrayView
5. Decorators for existing types
StringOps, ArrayOps
6. Related non collection types:
Iterator, StringBuilder
Operations covered in this strawman:
For iterables:
iterator, fromIterable, fromIterableWithSameElemType, knownLength, className
For sequences:
apply, length
For buildables:
newBuilder
For builders:
+=, result
2. Utility methods, might be overridden for performance:
Operations returning not necessarily a collection:
foreach, foldLeft, foldRight, indexWhere, isEmpty, head, size, mkString
Operations returning a collection of a fixed type constructor:
view, to, toArray, copyToArray
Type-preserving generic transforms:
filter, partition, take, drop, tail, reverse
Generic transforms returning collections of different element types:
map, flatMap, ++, zip
A strawman architecture for new collections. It contains some example collection classes and methods with the intent to expose some key issues. It would be good to compare this to other implementations of the same functionality, to get an idea of the strengths and weaknesses of different collection architectures.
For a test file, see tests/run/CollectionTests.scala.