-
Notifications
You must be signed in to change notification settings - Fork 797
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
WIP: Added standard module functions for ImmutableArray for FSharp.Core #15437
base: main
Are you sure you want to change the base?
WIP: Added standard module functions for ImmutableArray for FSharp.Core #15437
Conversation
let inline concat (arrs: IEnumerable<ImmutableArray<'T>>) : ImmutableArray<'T> = | ||
match arrs with | ||
| :? ImmutableArray<ImmutableArray<'T>> as arrs -> concatImmutableArrays arrs | ||
| arrs -> concatImmutableArrays (ImmutableArray.CreateRange(arrs)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you include the body of concatImmutableArrays in this function then collect can call concat. Which eliminates a wierd public api: concatImmutableArrays
TODO: Include ImmutableArray into existing property tests which exercise consistency between List/Array/Seq/ArrayParallel (this will also show if the main functions are covered or not) |
TODO: sorting? |
Been thinking about it, array's sorting is special, since it's in place. |
Do you remember location from the top of your head? |
module FSharp.Core.UnitTests.Collections.CollectionModulesConsistency |
I think that at least sortBy would be nice, otherwise user code would have to (even though it is what this impl will most likely do anyway..): on their own. |
You probably want to remove https://github.com/dotnet/fsharp/blob/cb106cf3182ff218f0a0e42780815dba94b60013/src/Compiler/Utilities/ImmutableArray.fs and use the new additions in F# Core. And will the |
No, not yet, this will break all scenarios where FSHARPCORE_USE_PACKAGE is used.
In separate PR, yes. This one is only about module functions. |
Based on the approved RFC - https://github.com/fsharp/fslang-design/blob/main/RFCs/FS-1094-immarray.md
A core library counterpart for the #12859
This is still missing:
Microsoft.FSharp..Collections.ImmutableArray
Microsoft.FSharp..Collections.ImmutableArray
(in particular around inlining).