on master help sign in
Fix divideBy and mergeBy signatures
8df3dc4Harendra Kumar
src/Streamly/Internal/Data/Array/Foreign/Mut/Type.hs+4−4
@@ -1230,7 +1230,7 @@ partitionBy = undefined
1230--
1230--
1231-- /Unimplemented/
1231-- /Unimplemented/
1232{-# INLINE shuffleBy #-}
1232{-# INLINE shuffleBy #-}
1233−shuffleBy :: (a -> a -> m Bool) -> Array a -> Array a -> m (Array a)
1233+shuffleBy :: (a -> a -> m Bool) -> Array a -> Array a -> m ()
1234shuffleBy = undefined
1234shuffleBy = undefined
1235
1235
1236-- XXX we can also make the folds partial by stopping at a certain level.
1236-- XXX we can also make the folds partial by stopping at a certain level.
@@ -1246,19 +1246,19 @@ shuffleBy = undefined
1246-- /Unimplemented/
1246-- /Unimplemented/
1247{-# INLINABLE divideBy #-}
1247{-# INLINABLE divideBy #-}
1248divideBy ::
1248divideBy ::
1249− Int -> (Array a -> Array a -> m (Array a)) -> Array a -> m (Array a)
1249+ Int -> (Array a -> m (Array a, Array a)) -> Array a -> m ()
1250divideBy = undefined
1250divideBy = undefined
1251
1251
1252-- | @mergeBy level merge array@ performs a pairwise bottom up fold recursively
1252-- | @mergeBy level merge array@ performs a pairwise bottom up fold recursively
1253-- merging the pairs using the supplied merge function. Level indicates the
1253-- merging the pairs using the supplied merge function. Level indicates the
1254-- level in the tree where the fold would stop.
1254-- level in the tree where the fold would stop.
1255--
1255--
1256−-- This performs a random shuffle if the shuffle function is random. If we
1256+-- This performs a random shuffle if the merge function is random. If we
1257-- stop at level 0 and repeatedly apply the function then we can do a bubble
1257-- stop at level 0 and repeatedly apply the function then we can do a bubble
1258-- sort.
1258-- sort.
1259--
1259--
1260-- /Unimplemented/
1260-- /Unimplemented/
1261−mergeBy :: Int -> (Array a -> Array a -> m (Array a)) -> Array a -> m (Array a)
1261+mergeBy :: Int -> (Array a -> Array a -> m ()) -> Array a -> m ()
1262mergeBy = undefined
1262mergeBy = undefined
1263
1263
1264-------------------------------------------------------------------------------
1264-------------------------------------------------------------------------------