[RFC FS-1094 Discussion] - "block" for immutable arrays #528
Replies: 8 comments 20 replies
-
Please add comments below if you'd like to contribute to the implementation of this RFC. Performance and correctness testing will be two important areas of work |
Beta Was this translation helpful? Give feedback.
-
Will this include a 2D |
Beta Was this translation helpful? Give feedback.
-
I wonder if it is worth adjusting the Block module rather than just adapting List/Array/Seq APIs verbatim, to smooth migration from
I copied my module implementing Block functions into this gist with the new terminology but it's all routine. |
Beta Was this translation helpful? Give feedback.
-
I think inconsistency between Block and List/Array/Seq would be too high a price to pay.
If we add for one collection type, we should add for all, per the design principles laid down in F# 4.0 collections revamp. |
Beta Was this translation helpful? Give feedback.
-
What is the rationale for basing Block on Being a value type, Just pointing out some things to think about, I'd love to know more about your thought process in this. |
Beta Was this translation helpful? Give feedback.
-
I've gone cold on the whole idea of @charlesroddie I've also gone cold on the |
Beta Was this translation helpful? Give feedback.
-
@dsyme if the [:
if foo then yield bar
match () with
| _ -> yield! bar2
:] |
Beta Was this translation helpful? Give feedback.
-
So "block" is out the window, and we're back to this I think:
For collection syntax, there is clearly a need for very lightweight syntax, with comprehension, for every collection type. I still don't see a "good" solution for this and will throw a few more ideas out there, They are a bit unfiltered but I want to get them into this discussion. TBH I'm feeling bad that after all this time I haven't settled on a design - or when I have I've felt it hasn't been good enough when I've come back to look at it again. One idea is we could somehow make the
Then in each file you can get whatever effect you want. Additionally we could throw in a couple of other syntax options
allowing
The exact form of the definitions I'm not sure of. Note it's possible Each of these definitions would work as eagerly-executing comprehensions. Perhaps the functions would have to provide a collector pattern. Perhaps somehow the functions could also define some kind of way to implement pattern matching for the collection type too. We could perhaps also allow type, direction disambiguation of these, so instead of
you could do
What would FSharp.Core contain? I'm not sure. Ideally at least a standard definition for immutable arrays. |
Beta Was this translation helpful? Give feedback.
-
Discussion thread for RFC FS-1094 block as FSharp.Core collection, an abbreviation for System.Collections.Immutable.ImmutableArray
Beta Was this translation helpful? Give feedback.
All reactions