Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 0 additions & 1 deletion core/src/Streamly/Data/Stream.hs
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,6 @@ module Streamly.Data.Stream
, scanMaybe
, postscan
, splitOn
, splitOnSeq
, unfoldMany
, intercalate
, intercalateSuffix
Expand Down
4 changes: 1 addition & 3 deletions core/src/Streamly/Internal/Data/Array.hs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ module Streamly.Internal.Data.Array
, deserialize

-- * Deprecated
, sliceEndBy_
, slicerFromLen
, sliceIndexerFromLen
, castUnsafe
Expand Down Expand Up @@ -267,10 +266,9 @@ getSliceUnsafe ::
-> Array a
RENAME(getSliceUnsafe,unsafeSliceOffLen)

sliceEndBy_, splitOn :: (Monad m, Unbox a) =>
splitOn :: (Monad m, Unbox a) =>
(a -> Bool) -> Array a -> Stream m (Array a)
RENAME(splitOn,splitEndBy_)
RENAME(sliceEndBy_,splitEndBy_)

{-# INLINE indexerFromLen #-}
indexerFromLen, sliceIndexerFromLen :: forall m a. (Monad m, Unbox a)
Expand Down
4 changes: 1 addition & 3 deletions core/src/Streamly/Internal/Data/Array/Generic/Type.hs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ module Streamly.Internal.Data.Array.Generic.Type
, strip
, getIndexUnsafe
, getSliceUnsafe
, unsafeGetSlice
, writeN
, write
, fromByteStr#
Expand Down Expand Up @@ -302,7 +301,7 @@ createOfLast n = FL.rmapM f (RB.createOf n)
return $ unsafeFreeze arr

{-# INLINE unsafeSliceOffLen #-}
unsafeSliceOffLen, getSliceUnsafe, unsafeGetSlice
unsafeSliceOffLen, getSliceUnsafe
:: Int -> Int -> Array a -> Array a
unsafeSliceOffLen offset len =
unsafeFreeze . MArray.unsafeSliceOffLen offset len . unsafeThaw
Expand Down Expand Up @@ -372,7 +371,6 @@ instance Read a => Read (Array a) where

RENAME(strip,dropAround)
RENAME(getSliceUnsafe,unsafeSliceOffLen)
RENAME(unsafeGetSlice,unsafeSliceOffLen)
RENAME(getIndexUnsafe,unsafeGetIndex)

--------------------------------------------------------------------------------
Expand Down
20 changes: 5 additions & 15 deletions core/src/Streamly/Internal/Data/Array/Type.hs
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,8 @@ module Streamly.Internal.Data.Array.Type
, compactMin

-- ** Deprecated
, unsafeGetSlice
, strip
, stripStart
, stripEnd
, breakOn
, splitAt
, unsafeSplitAt
, asPtrUnsafe
, unsafeIndex
, bufferChunks
Expand Down Expand Up @@ -550,7 +545,7 @@ fromStreamD = fromStream
--
-- /Pre-release/
{-# INLINE unsafeSliceOffLen #-}
unsafeSliceOffLen, unsafeGetSlice ::
unsafeSliceOffLen ::
forall a. Unbox a
=> Int -- ^ starting index
-> Int -- ^ length of the slice
Expand All @@ -561,7 +556,6 @@ unsafeSliceOffLen index len (Array contents start e) =
start1 = start + (index * size)
end1 = start1 + (len * size)
in assert (end1 <= e) (Array contents start1 end1)
RENAME(unsafeGetSlice,unsafeSliceOffLen)

-------------------------------------------------------------------------------
-- Elimination
Expand Down Expand Up @@ -1022,14 +1016,13 @@ foldr f z arr = runIdentity $ D.foldr f z $ toStreamD arr
-- | Like 'breakAt' but does not check whether the index is valid.
--
{-# INLINE unsafeBreakAt #-}
unsafeBreakAt, unsafeSplitAt :: Unbox a =>
unsafeBreakAt :: Unbox a =>
Int -> Array a -> (Array a, Array a)
unsafeBreakAt i arr = (unsafeFreeze a, unsafeFreeze b)

where

(a, b) = MA.unsafeBreakAt i (unsafeThaw arr)
RENAME(unsafeSplitAt,unsafeBreakAt)

-- | Create two slices of an array without copying the original array. The
-- specified index @i@ is the first index of the second slice.
Expand Down Expand Up @@ -1081,28 +1074,25 @@ revBreakEndBy_ p arr = (unsafeFreeze a, unsafeFreeze b)
--
-- /Pre-release/
{-# INLINE dropAround #-}
dropAround, strip :: Unbox a => (a -> Bool) -> Array a -> Array a
dropAround :: Unbox a => (a -> Bool) -> Array a -> Array a
dropAround eq arr =
unsafeFreeze $ unsafePerformIO $ MA.dropAround eq (unsafeThaw arr)
RENAME(strip,dropAround)

-- | Strip elements which match the predicate, from the start of the array.
--
-- /Pre-release/
{-# INLINE dropWhile #-}
dropWhile, stripStart :: Unbox a => (a -> Bool) -> Array a -> Array a
dropWhile :: Unbox a => (a -> Bool) -> Array a -> Array a
dropWhile eq arr =
unsafeFreeze $ unsafePerformIO $ MA.dropWhile eq (unsafeThaw arr)
RENAME(stripStart,dropWhile)

-- | Strip elements which match the predicate, from the end of the array.
--
-- /Pre-release/
{-# INLINE revDropWhile #-}
revDropWhile, stripEnd :: Unbox a => (a -> Bool) -> Array a -> Array a
revDropWhile :: Unbox a => (a -> Bool) -> Array a -> Array a
revDropWhile eq arr =
unsafeFreeze $ unsafePerformIO $ MA.revDropWhile eq (unsafeThaw arr)
RENAME(stripEnd,revDropWhile)

-- Use foldr/build fusion to fuse with list consumers
-- This can be useful when using the IsList instance
Expand Down
8 changes: 0 additions & 8 deletions core/src/Streamly/Internal/Data/IORef.hs
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ module Streamly.Internal.Data.IORef
, readIORef
, pollGenericIORef
, pollIORefInt

-- Deprecated
, pollIntIORef
)
where

Expand Down Expand Up @@ -103,11 +100,6 @@ pollGenericIORef var = D.Stream step ()
{-# INLINE_LATE step #-}
step _ () = liftIO (readIORef var) >>= \x -> return $ D.Yield x ()

{-# DEPRECATED pollIntIORef "Use pollIORefInt instead." #-}
{-# INLINE_NORMAL pollIntIORef #-}
pollIntIORef :: (MonadIO m, Unbox a) => IORef a -> D.Stream m a
pollIntIORef = pollGenericIORef

-- | Generate a stream by continuously reading the IORef.
--
-- This operation reads the IORef without any synchronization. It can be
Expand Down
4 changes: 1 addition & 3 deletions core/src/Streamly/Internal/Data/MutArray/Generic.hs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ module Streamly.Internal.Data.MutArray.Generic
, clone

-- * Deprecated
, unsafeGetSlice
, getSlice
, strip
, new
Expand Down Expand Up @@ -537,7 +536,7 @@ getIndex i arr =
--
-- /Pre-release/
{-# INLINE unsafeSliceOffLen #-}
unsafeSliceOffLen, getSliceUnsafe, unsafeGetSlice
unsafeSliceOffLen, getSliceUnsafe
:: Int -- ^ from index
-> Int -- ^ length of the slice
-> MutArray a
Expand Down Expand Up @@ -977,7 +976,6 @@ RENAME(modifyIndexUnsafe, unsafeModifyIndex)
RENAME(getIndexUnsafe, unsafeGetIndex)
RENAME(getIndexUnsafeWith, unsafeGetIndexWith)
RENAME(getSliceUnsafe,unsafeSliceOffLen)
RENAME(unsafeGetSlice,unsafeSliceOffLen)
RENAME(putSliceUnsafe, unsafePutSlice)
RENAME(getSlice,sliceOffLen)
RENAME(snocUnsafe, unsafeSnoc)
20 changes: 5 additions & 15 deletions core/src/Streamly/Internal/Data/MutArray/Type.hs
Original file line number Diff line number Diff line change
Expand Up @@ -421,15 +421,10 @@ module Streamly.Internal.Data.MutArray.Type
, roundUpToPower2

-- * Deprecated
, unsafeGetSlice
, getSlice
, sliceEndBy_
, strip
, stripStart
, stripEnd
, breakOn
, splitAt
, unsafeSplitAt
, realloc
, createOfWith
, peekUncons
Expand Down Expand Up @@ -1615,7 +1610,7 @@ getIndices = indexReader
--
-- /Pre-release/
{-# INLINE unsafeSliceOffLen #-}
unsafeSliceOffLen, getSliceUnsafe, unsafeGetSlice :: forall a. Unbox a
unsafeSliceOffLen, getSliceUnsafe :: forall a. Unbox a
=> Int -- ^ from index
-> Int -- ^ length of the slice
-> MutArray a
Expand Down Expand Up @@ -3325,12 +3320,11 @@ splitUsing f predicate arr =
--
-- /Pre-release/
{-# INLINE splitEndBy_ #-}
splitEndBy_, sliceEndBy_, splitOn :: (MonadIO m, Unbox a) =>
splitEndBy_, splitOn :: (MonadIO m, Unbox a) =>
(a -> Bool) -> MutArray a -> Stream m (MutArray a)
splitEndBy_ = splitUsing D.indexEndBy_

RENAME(splitOn,splitEndBy_)
RENAME(sliceEndBy_,splitEndBy_)

-- | Generate a stream of array slices using a predicate. The array element
-- matching the predicate is included.
Expand Down Expand Up @@ -3484,7 +3478,7 @@ RENAME(breakOn,breakEndByWord8_)
-- >>> unsafeBreakAt i arr = (MutArray.unsafeSliceOffLen 0 i arr, MutArray.unsafeSliceOffLen i (MutArray.length arr - i) arr)
--
{-# INLINE unsafeBreakAt #-}
unsafeBreakAt, unsafeSplitAt :: forall a. Unbox a =>
unsafeBreakAt :: forall a. Unbox a =>
Int -> MutArray a -> (MutArray a, MutArray a)
unsafeBreakAt i MutArray{..} =
-- (unsafeSliceOffLen 0 i arr, unsafeSliceOffLen i (length arr - i) arr)
Expand All @@ -3503,7 +3497,6 @@ unsafeBreakAt i MutArray{..} =
, arrBound = arrBound
}
)
RENAME(unsafeSplitAt,unsafeBreakAt)

-- | Create two slices of an array without copying the original array. The
-- specified index @i@ is the first index of the second slice.
Expand Down Expand Up @@ -4131,7 +4124,7 @@ retractEndTill eq MutArray{..} = go arrEnd
--
-- /Pre-release/
{-# INLINE dropWhile #-}
dropWhile, stripStart :: forall a m. (Unbox a, MonadIO m) =>
dropWhile :: forall a m. (Unbox a, MonadIO m) =>
(a -> Bool) -> MutArray a -> m (MutArray a)
dropWhile eq arr@MutArray{..} = liftIO $ do
st <- advanceStartTill eq arr
Expand All @@ -4140,7 +4133,6 @@ dropWhile eq arr@MutArray{..} = liftIO $ do
if st >= arrEnd
then empty
else arr{arrStart = st}
RENAME(stripStart,dropWhile)

-- | Strip elements which match the predicate, from the end of the array.
--
Expand All @@ -4151,7 +4143,7 @@ RENAME(stripStart,dropWhile)
--
-- /Pre-release/
{-# INLINE revDropWhile #-}
revDropWhile, stripEnd :: forall a m. (Unbox a, MonadIO m) =>
revDropWhile :: forall a m. (Unbox a, MonadIO m) =>
(a -> Bool) -> MutArray a -> m (MutArray a)
revDropWhile eq arr@MutArray{..} = liftIO $ do
end <- retractEndTill eq arr
Expand All @@ -4160,7 +4152,6 @@ revDropWhile eq arr@MutArray{..} = liftIO $ do
if end <= arrStart
then empty
else arr{arrEnd = end}
RENAME(stripEnd,revDropWhile)

-- | Strip elements which match the predicate, from both ends.
--
Expand Down Expand Up @@ -4211,7 +4202,6 @@ RENAME(realloc,reallocBytes)
RENAME(castUnsafe,unsafeCast)
RENAME(newArrayWith,emptyWithAligned)
RENAME(getSliceUnsafe,unsafeSliceOffLen)
RENAME(unsafeGetSlice,unsafeSliceOffLen)
RENAME(getSlice,sliceOffLen)
RENAME(putIndexUnsafe,unsafePutIndex)
RENAME(modifyIndexUnsafe,unsafeModifyIndex)
Expand Down
13 changes: 3 additions & 10 deletions core/src/Streamly/Internal/Data/Stream/Nesting.hs
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,6 @@ module Streamly.Internal.Data.Stream.Nesting
, parseIterateD
, groupsBy
, splitOnSeq
, unfoldEachInterleave
, unfoldEachInterleaveRev
, unfoldEachRoundRobin
)
where

Expand Down Expand Up @@ -790,7 +787,7 @@ data BfsUnfoldEachState o i =
-- CAUTION! Do not use on infinite streams.
--
{-# INLINE_NORMAL bfsUnfoldEach #-}
bfsUnfoldEach, unfoldEachInterleave :: Monad m =>
bfsUnfoldEach :: Monad m =>
Unfold m a b -> Stream m a -> Stream m b
bfsUnfoldEach (Unfold istep inject) (Stream ostep ost) =
Stream step (BfsUnfoldEachOuter ost id)
Expand Down Expand Up @@ -819,8 +816,6 @@ bfsUnfoldEach (Unfold istep inject) (Stream ostep ost) =
Skip s -> Skip (BfsUnfoldEachInner (s:ls) rs)
Stop -> Skip (BfsUnfoldEachInner ls rs)

RENAME(unfoldEachInterleave, bfsUnfoldEach)

data ConcatUnfoldInterleaveState o i =
ConcatUnfoldInterleaveOuter o [i]
| ConcatUnfoldInterleaveInner o [i]
Expand All @@ -839,7 +834,7 @@ data ConcatUnfoldInterleaveState o i =
-- CAUTION! Do not use on infinite streams.
--
{-# INLINE_NORMAL altBfsUnfoldEach #-}
altBfsUnfoldEach, unfoldEachInterleaveRev, unfoldInterleave :: Monad m =>
altBfsUnfoldEach, unfoldInterleave :: Monad m =>
Unfold m a b -> Stream m a -> Stream m b
altBfsUnfoldEach (Unfold istep inject) (Stream ostep ost) =
Stream step (ConcatUnfoldInterleaveOuter ost [])
Expand Down Expand Up @@ -887,7 +882,6 @@ altBfsUnfoldEach (Unfold istep inject) (Stream ostep ost) =
Stop -> Skip (ConcatUnfoldInterleaveInnerR ls rs)

RENAME(unfoldInterleave,altBfsUnfoldEach)
RENAME(unfoldEachInterleaveRev,altBfsUnfoldEach)

-- XXX In general we can use different scheduling strategies e.g. how to
-- schedule the outer vs inner loop or assigning weights to different streams
Expand All @@ -911,7 +905,7 @@ RENAME(unfoldEachInterleaveRev,altBfsUnfoldEach)
-- CAUTION! Do not use on infinite streams.
--
{-# INLINE_NORMAL unfoldSched #-}
unfoldSched, unfoldEachRoundRobin, unfoldRoundRobin :: Monad m =>
unfoldSched, unfoldRoundRobin :: Monad m =>
Unfold m a b -> Stream m a -> Stream m b
unfoldSched (Unfold istep inject) (Stream ostep ost) =
Stream step (BfsUnfoldEachOuter ost id)
Expand Down Expand Up @@ -941,7 +935,6 @@ unfoldSched (Unfold istep inject) (Stream ostep ost) =
Stop -> Skip (BfsUnfoldEachInner ls rs)

RENAME(unfoldRoundRobin,unfoldSched)
RENAME(unfoldEachRoundRobin,unfoldSched)

-- | Round robin co-operative scheduling of multiple streams.
--
Expand Down
11 changes: 4 additions & 7 deletions core/src/Streamly/Internal/Data/Unfold/Type.hs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ module Streamly.Internal.Data.Unfold.Type
, map2
, mapM2
, takeWhileMWithInput
, unfoldEach2
)
where

Expand Down Expand Up @@ -581,11 +580,11 @@ crossApplyFst (Unfold _step1 _inject1) (Unfold _step2 _inject2) = undefined
data Many2State x s1 s2 = Many2Outer x s1 | Many2Inner x s1 s2
-}

{-# DEPRECATED unfoldEach2 "Use carry with unfoldEach instead." #-}
{-# INLINE_NORMAL unfoldEach2 #-}
unfoldEach2, many2 :: Monad m =>
{-# DEPRECATED many2 "Use carry with unfoldEach instead." #-}
{-# INLINE_NORMAL many2 #-}
many2 :: Monad m =>
Unfold m (a, b) c -> Unfold m a b -> Unfold m a c
unfoldEach2 u1 u2 = unfoldEach u1 (carry u2)
many2 u1 u2 = unfoldEach u1 (carry u2)
{-
unfoldEach2 (Unfold step2 inject2) (Unfold step1 inject1) = Unfold step inject

Expand Down Expand Up @@ -613,8 +612,6 @@ unfoldEach2 (Unfold step2 inject2) (Unfold step1 inject1) = Unfold step inject
Stop -> Skip (Many2Outer a ost)
-}

RENAME(many2,unfoldEach2)

data Cross a s1 b s2 = CrossOuter a s1 | CrossInner a s1 b s2

-- >> f1 f u = Unfold.mapM (\((_, c), b) -> f b c) Unfold.carry (Unfold.lmap fst u))
Expand Down
Loading
Loading