1

Scala collections API is rather nice.

The way that both mutable and immutable types follow the same tree structure makes it very elegant.

I was just wandering if there is anything out there that implements Scala-like collections. Oh, and don't say C5 because it does not have truly immutable collections.

svick
  • 236,525
  • 50
  • 385
  • 514
Andriy Drozdyuk
  • 58,435
  • 50
  • 171
  • 272
  • 1
    for immutable collections, you can take a look at http://stackoverflow.com/questions/927181/immutable-collections and http://stackoverflow.com/questions/3485262/efficient-immutable-extensible-collections-for-net – Paolo Falabella Sep 21 '12 at 14:56
  • Nice thanks! Just what i wanted – Andriy Drozdyuk Sep 21 '12 at 15:54
  • @PaoloFalabella Right... that doesn't really do what I want. I was hoping for a coherent and complete interface hierarchy for both mutable and immutable types. Implementing it myself is very time consuming and error-prone, while using F# one is restricted to classes only as it does not provide interfaces for things like FSharpList. Well, if I find something, I'll post an answer here. – Andriy Drozdyuk Sep 27 '12 at 05:32

1 Answers1

3

.NET just shipped their first immutable collections, which I suggest you try out.

In particular, these with .NET 4.5 offer the shared read only interfaces that work on both mutable and immutable collections that it sounds like you're looking for, while offering efficient copy-on-write implementations of collections.

Andrew Arnott
  • 80,040
  • 26
  • 132
  • 171