[Repo Assist] feat: add ofList, ofArray, tryFind, find, choose, collect, partition, sort, sortWith, sortBy, rev to DList#260
Draft
github-actions[bot] wants to merge 2 commits intomasterfrom
Conversation
… sort, sortWith, sortBy, rev to DList Expand the DList module with 11 standard collection functions: - ofList / ofArray: build a DList from an existing list or array - tryFind / find: search for elements matching a predicate - choose: filter-and-map, returning a new DList of Some values - collect: monadic bind / flat-map over DList - partition: split into two DLists based on a predicate - sort / sortWith / sortBy: O(n log n) sorting via Array round-trip - rev: O(n) reversal via fold Add 11 property-based tests covering all new functions, verifying consistency with the equivalent List operations. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 This PR was created by Repo Assist, an automated AI assistant.
Summary
Expands the
DListmodule with 11 standard collection functions that were previously absent, bringingDListcloser to parity with the coreListmodule.Functions Added
ofListDListfrom a plain'T listofArrayDListfrom a'T arraytryFind'T optionfor first matching elementfind'Tor raiseKeyNotFoundExceptionchooseDList<'U>collectpartitionDLists by predicatesortcomparisonsortWithsortByrevfoldAll implementations are consistent with their
List/Arraycounterparts and verified by property-based tests.Tests
11 property-based tests added to
DListTest.fs, each verifying that the newDListfunction produces the same result as the equivalentListoperation.Test Status
✅ All 907 tests pass (0 failures, 2 skipped) via
dotnet test. Fantomas formatting check passes.