Skip to content

[Repo Assist] feat: add filter, iter, fold, exists, forall, choose, tryFind, toList, toArray, ofList, ofArray, keys, values to PersistentHashM [Content truncated due to length]#254

Open
github-actions[bot] wants to merge 2 commits intomasterfrom
repo-assist/improve-persistenthashmap-functions-2026-03-15-f9da3c6901d0f554
Open

[Repo Assist] feat: add filter, iter, fold, exists, forall, choose, tryFind, toList, toArray, ofList, ofArray, keys, values to PersistentHashM [Content truncated due to length]#254
github-actions[bot] wants to merge 2 commits intomasterfrom
repo-assist/improve-persistenthashmap-functions-2026-03-15-f9da3c6901d0f554

Conversation

@github-actions
Copy link
Contributor

🤖 This PR was created by Repo Assist, an automated AI assistant.

Summary

PersistentHashMap was missing many common collection functions that exist in FSharp.Collections.Map. This PR adds 13 new functions to align the API and addresses #152.

Function Description
tryFind Returns Some value for an existing key, None for missing
filter Returns a new map containing only entries where the predicate returns true
iter Applies a side-effecting function to every key-value pair
fold Threads an accumulator through all key-value pairs
exists Returns true if any entry satisfies the predicate
forall Returns true if all entries satisfy the predicate
choose Selects and transforms entries; excludes None results
toList Converts the map to a (key * value) list
toArray Converts the map to a (key * value) array
ofList Creates a map from a (key * value) list
ofArray Creates a map from a (key * value) array
keys Returns a sequence of all keys
values Returns a sequence of all values

Motivation

FSharp.Collections.Map has all of these functions. Consumers who switch from Map to PersistentHashMap for its O(log32n) operations hit immediate API gaps. Closing this gap makes PersistentHashMap a first-class persistent map.

Test Status

All 754 tests pass (760 total, 6 pre-existing ptests skipped). 16 new tests added covering all new functions, including round-trip and edge-case checks.

Closes (partially) #152

Generated by Repo Assist ·

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@346204513ecfa08b81566450d7d599556807389f

…, toArray, ofList, ofArray, keys, values to PersistentHashMap; 16 new tests

All 754 tests pass. Addresses #152 (Align Collection Module functions
with FSharp.Collections).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dsyme dsyme marked this pull request as ready for review March 16, 2026 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants