facebook-csharp-sdk / simple-json

JSON library for .NET 2.0+/SL4+/WP7/WindowsStore with optional support for dynamic and DataContract
MIT License
382 stars 143 forks source link

Immutable Collections - anyone else *need* this? #42

Open shiftkey opened 11 years ago

shiftkey commented 11 years ago

Octokit.NET uses SimpleJson heavily, and with the license changes to Microsoft.Bcl.Immutable we can now use the System.Collections.Immutable namespaces rather than our custom implementations

BUT

There's a whole bunch of changes to how you can create ImmutableColllections (that is, the concrete implementations of IImmutableCollection) that break existing assumptions.

public interface IImmutableDictionary<TKey, TValue> 
    : IReadOnlyDictionary<TKey, TValue>,
      IReadOnlyCollection<KeyValuePair<TKey, TValue>>,
      IEnumerable<KeyValuePair<TKey, TValue>>, 
      IEnumerable

versus

public interface IDictionary<TKey, TValue> 
    : ICollection<KeyValuePair<TKey, TValue>>, 
      IEnumerable<KeyValuePair<TKey, TValue>>,
      IEnumerable

for example.

I've made some progress here on getting this scenario running, but it's not ready for a review or even a PR.

Thoughts?

prabirshrestha commented 11 years ago

I would definitely be interested in getting this in the core.

I will be gone for MVP summit this week, so not sure if I will be able to look at your PRs or dive into this more, but please feel free to submit a PR.

shiftkey commented 11 years ago

@prabirshrestha i'll also be around for MVP summit. It's not urgent, but I'll keep that feedback in mind...

prabirshrestha commented 11 years ago

@shiftkey cool. we should meet. feel free to ping me on twitter. same username as github.