New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement IReadOnly interfaces on relevant F# collections throughout FSharp.Core [ RFC FS-1041 ] #624

Closed
cartermp opened this Issue Nov 22, 2017 · 6 comments

Comments

Projects
None yet
4 participants
@cartermp
Member

cartermp commented Nov 22, 2017

I propose we implement IReadOnly* interfaces on F# collections throughout FSharp.Core. This is an issue on VisualFSharp as well: Microsoft/visualfsharp#3999

Pros and Cons

The advantages of making this adjustment to F# are ...

  • They make sense, given that F# collections (sans Array) are immutable.
  • This is really just something that's "missing" from FSharp.Core in general.

The disadvantages of making this adjustment to F# are ...

  • It's code churn

Extra information

Estimated cost (XS, S, M, L, XL, XXL): S

Related suggestions: #181

Affidavit (please submit!)

Please tick this by placing a cross in the box:

  • This is not a question (e.g. like one you might ask on stackoverflow) and I have searched stackoverflow for discussions of this issue
  • I have searched both open and closed suggestions on this site and believe this is not a duplicate
  • This is not something which has obviously "already been decided" in previous versions of F#. If you're questioning a fundamental design decision that has obviously already been taken (e.g. "Make F# untyped") then please don't submit it.

Please tick all that apply:

  • This is not a breaking change to the F# language design
  • I or my company would be willing to help implement and/or test this

@cartermp cartermp changed the title from Implement IReadOnly interfaces on F# collections throughout FSharp.Core to Implement IReadOnly interfaces on relevant F# collections throughout FSharp.Core Nov 22, 2017

@dsyme

This comment has been minimized.

Show comment
Hide comment
@dsyme

dsyme Nov 23, 2017

Collaborator

Labelled as approved

Collaborator

dsyme commented Nov 23, 2017

Labelled as approved

@saul

This comment has been minimized.

Show comment
Hide comment
@saul

saul commented Nov 25, 2017

@dsyme dsyme changed the title from Implement IReadOnly interfaces on relevant F# collections throughout FSharp.Core to Implement IReadOnly interfaces on relevant F# collections throughout FSharp.Core [ RFC FS-1041 ] Dec 1, 2017

@dsyme

This comment has been minimized.

Show comment
Hide comment
@saul

This comment has been minimized.

Show comment
Hide comment
@saul

saul Dec 17, 2017

Can we use this issue to discuss the fact that dict cannot be modified to return an IReadOnlyDictionary as the types are incompatible.

I suggest we add a readOnlyDict top-level operator that takes the same pair sequence as dict, but returns an IReadOnlyDictionary instead.

saul commented Dec 17, 2017

Can we use this issue to discuss the fact that dict cannot be modified to return an IReadOnlyDictionary as the types are incompatible.

I suggest we add a readOnlyDict top-level operator that takes the same pair sequence as dict, but returns an IReadOnlyDictionary instead.

@PatrickMcDonald

This comment has been minimized.

Show comment
Hide comment
@PatrickMcDonald

PatrickMcDonald Dec 17, 2017

There's a suggestion #619 to create an Immutable Array. The name given to the readOnlyDIct function should be consistent with any constructor function chosen for ImmutableArray (or vice versa)

PatrickMcDonald commented Dec 17, 2017

There's a suggestion #619 to create an Immutable Array. The name given to the readOnlyDIct function should be consistent with any constructor function chosen for ImmutableArray (or vice versa)

@cartermp

This comment has been minimized.

Show comment
Hide comment
@cartermp

cartermp May 27, 2018

Member

This is now completed.

Member

cartermp commented May 27, 2018

This is now completed.

@cartermp cartermp closed this May 27, 2018

@cartermp cartermp added completed and removed started labels Jun 25, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment