KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Seq.windowed in F# returns a sequence where each window within is an array. Is there a reason why each window is returned as an array (a very concrete type) as opposed to say, another sequence or IList<'T> ? An IList<'T> , for example, would be sufficient if the purpose was to communicate that the items of the window can be randomly accessed but an array says two things: elements are mutable and randomly accessible. If you can rationalise the choice of array, how is windowed different from Seq.groupBy ? Why does that latter (or operators in the same vein) not also return the members of a group as an array? I'm wondering if this is simply a design oversight or is there a deeper, contractual reason for an array?
Tags (comma-separated)
Save Edits
Cancel