Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Non-atomic list streaming #34

Merged
merged 1 commit into from
May 8, 2024
Merged
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
11 changes: 9 additions & 2 deletions library/StmContainers/Map.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
reset,
unfoldlM,
listT,
listTNonAtomic,
)
where

Expand Down Expand Up @@ -111,5 +112,11 @@
-- Stream the associations passively.
{-# INLINE listT #-}
listT :: Map key value -> ListT STM (key, value)
listT (Map hamt) =
fmap (\(Product2 k v) -> (k, v)) (A.listT hamt)
listT (Map hamt) = fmap (\(Product2 k v) -> (k, v)) (A.listT hamt)

-- |
-- Stream the associations passively.
-- Data may be inconsistent/out of date.
{-# INLINE listTNonAtomic #-}
listTNonAtomic :: Map key value -> ListT IO (key, value)
listTNonAtomic (Map hamt) = fmap (\(Product2 k v) -> (k, v)) (A.listTNonAtomic hamt)

Check failure on line 122 in library/StmContainers/Map.hs

View workflow job for this annotation

GitHub Actions / check / check (8.8.1, true)

Not in scope: ‘A.listTNonAtomic’

Check failure on line 122 in library/StmContainers/Map.hs

View workflow job for this annotation

GitHub Actions / check / check (latest)

Not in scope: ‘A.listTNonAtomic’
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.