Skip to content

Commit

Permalink
Implement differenceBySorted API
Browse files Browse the repository at this point in the history
  • Loading branch information
rnjtranjan committed Mar 6, 2022
1 parent b2e386a commit 3dd70d9
Show file tree
Hide file tree
Showing 3 changed files with 710 additions and 5 deletions.
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 @@ -30,7 +30,7 @@ module Streamly.Internal.Data.Stream.IsStream.Top
, intersectBy
, intersectBySorted
, differenceBy
, mergeDifferenceBy
, differenceBySorted
, unionBy
, mergeUnionBy

Expand Down Expand Up @@ -632,11 +632,14 @@ differenceBy eq s1 s2 =
--
-- Space: O(1)
--
-- /Unimplemented/
{-# INLINE mergeDifferenceBy #-}
mergeDifferenceBy :: -- (IsStream t, Monad m) =>
-- /Pre-release/
{-# INLINE differenceBySorted #-}
differenceBySorted :: (IsStream t, MonadIO m) =>
(a -> a -> Ordering) -> t m a -> t m a -> t m a
mergeDifferenceBy _eq _s1 _s2 = undefined
differenceBySorted eq s1 =
IsStream.fromStreamD
. StreamD.differenceBySorted eq (IsStream.toStreamD s1)
. IsStream.toStreamD

-- | This is essentially an append operation that appends all the extra
-- occurrences of elements from the second stream that are not already present
Expand Down
Loading

0 comments on commit 3dd70d9

Please sign in to comment.