Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ Agents discover servers from #file:'.mcp.json'; these are only hints on when to
* When casting sequence items use `Seq.cast<TargetType>` instead of `Seq.map (fun item -> item :> TargetType)`.
* When concatenating two sequences or lists, prefer `seq { yield! xs; yield! ys }` (or `[ yield! xs; yield! ys ]` for lists) over the `@` operator or `Seq.append`.
* When pipe operators are used on a materializable collection multiple times in a row, prefer `Seq` module for the chain and materialize at the end.
* Keep a pipeline in harmony: when consecutive steps can come from one module, take them from that module, the conversion at the end included – `xs |> Seq.filter isValid |> Seq.sort |> Seq.toArray`, not `… |> Seq.sort |> Array.ofSeq`, and `items |> List.map _.Id |> List.toArray`, not `… |> Array.ofList`. Change the module only where the steps that follow need the other collection.

### Functions, Lambdas and Strings

Expand Down
4 changes: 2 additions & 2 deletions tests/Cosmos.Tests/IterationExtensionsTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type IterationExtensionsIntegrationTests () =
Assert.HasCount (2, iteratedItems, "FeedIterator.AsAsyncEnumerable should return exactly the seeded items.")
CollectionAssert.AreEquivalent (
expectedIds,
iteratedItems |> List.map _.id |> Array.ofList,
iteratedItems |> List.map _.id |> List.toArray,
"FeedIterator.AsAsyncEnumerable should iterate seeded items without duplicates or omissions."
)
}
Expand All @@ -59,7 +59,7 @@ type IterationExtensionsIntegrationTests () =
Assert.HasCount (2, iteratedItems, "IQueryable.AsAsyncEnumerable should return exactly the seeded items.")
CollectionAssert.AreEquivalent (
expectedIds,
iteratedItems |> List.map _.id |> Array.ofList,
iteratedItems |> List.map _.id |> List.toArray,
"IQueryable.AsAsyncEnumerable should iterate seeded items without duplicates or omissions."
)
}
Loading