Skip to content
Draft
Show file tree
Hide file tree
Changes from 4 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
4 changes: 4 additions & 0 deletions benchmark/Streamly/Benchmark/Prelude/Serial/NestedStream.hs
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,10 @@ o_n_heap_buffering value =
$ joinWith Internal.intersectBy sqrtVal
, benchIOSrc1 "intersectBySorted"
$ joinMapWith (Internal.intersectBySorted compare) halfVal
, benchIOSrc1 "unionBy (sqrtVal)"
$ joinWith Internal.unionBy sqrtVal
, benchIOSrc1 "unionBySorted"
$ joinMapWith (Internal.unionBySorted compare) halfVal
]
]

Expand Down
13 changes: 8 additions & 5 deletions src/Streamly/Internal/Data/Stream/IsStream/Top.hs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ module Streamly.Internal.Data.Stream.IsStream.Top
, differenceBy
, mergeDifferenceBy
, unionBy
, mergeUnionBy
, unionBySorted

-- ** Join operations
, crossJoin
Expand Down Expand Up @@ -680,8 +680,11 @@ unionBy eq s1 s2 =
--
-- Space: O(1)
--
-- /Unimplemented/
{-# INLINE mergeUnionBy #-}
mergeUnionBy :: -- (IsStream t, Monad m) =>
-- /Pre-release/
{-# INLINE unionBySorted #-}
unionBySorted :: (IsStream t, MonadAsync m, Ord a) =>
(a -> a -> Ordering) -> t m a -> t m a -> t m a
mergeUnionBy _eq _s1 _s2 = undefined
unionBySorted cmp s1 =
IsStream.fromStreamD
. StreamD.unionBySorted cmp (IsStream.toStreamD s1)
. IsStream.toStreamD
Loading