on master help sign in
rename unlinesBy to concatWithSuffix

This is consistent with the naming of its counterpart splitWithSuffix.

commitfb39bc3e1b6c874ca49ac23c64ec463a09630f15 authorHarendra Kumar <harendra.kumar@gmail.com> dateSat 17 Aug 2019, 05:03 (7 years ago) parent9bf7415
3 files changed+8−8
src/Streamly/Data/String.hs+3−3 src/Streamly/Memory/Array.hs+1−1 src/Streamly/Memory/ArrayStream.hs+4−4
src/Streamly/Data/String.hs+3−3
@@ -250,14 +250,14 @@ words = foldWords A.write
250250-- >>> S.toList $ unlines $ S.fromList ["lines", "this", "string"]
251251-- "lines\nthis\nstring\n"
252252--
253−-- > unlines = AS.unlinesBy '\n'
253+-- > unlines = A.concatWithSuffix '\n'
254254--
255255-- Note that, in general
256256--
257257-- > unlines . lines /= id
258258{-# INLINE unlines #-}
259259unlines :: (MonadIO m, IsStream t) => t m (Array Char) -> t m Char
260−unlines = AS.unlinesBy '\n'
260+unlines = A.concatWithSuffix '\n'
261261
262262-- | Flattens the stream of @Array Char@, after appending a separating
263263-- space to each string.
@@ -268,7 +268,7 @@ unlines = AS.unlinesBy '\n'
268268-- "unwords this string"
269269--
270270--
271−-- > unwords = AS.flatten . (S.intersperse (A.fromList " "))
271+-- > unwords = A.concat . (S.intersperse (A.fromList " "))
272272--
273273-- Note that, in general
274274--
src/Streamly/Memory/Array.hs+1−1
@@ -127,7 +127,7 @@ module Streamly.Memory.Array
127127 -- ** Elimination
128128 , AS.concat
129129 -- , AS.concatRev
130− , AS.unlinesBy
130+ , AS.concatWithSuffix
131131 , AS.toArray
132132
133133 -- ** Transformation
src/Streamly/Memory/ArrayStream.hs+4−4
@@ -26,7 +26,7 @@ module Streamly.Memory.ArrayStream
2626 -- * Flattening to elements
2727 , concat
2828 , concatRev
29− , unlinesBy
29+ , concatWithSuffix
3030
3131 -- * Transformation
3232 , splitOn
@@ -87,10 +87,10 @@ concatRev m = D.fromStreamD $ A.flattenArraysRev (D.toStreamD m)
8787-- array.
8888--
8989-- @since 0.7.0
90−{-# INLINE unlinesBy #-}
91−unlinesBy :: (MonadIO m, IsStream t, Storable a)
90+{-# INLINE concatWithSuffix #-}
91+concatWithSuffix :: (MonadIO m, IsStream t, Storable a)
9292 => a -> t m (Array a) -> t m a
93−unlinesBy x = D.fromStreamD . A.unlines x . D.toStreamD
93+concatWithSuffix x = D.fromStreamD . A.unlines x . D.toStreamD
9494
9595-- | Split a stream of arrays on a given separator byte, dropping the separator
9696-- and coalescing all the arrays between two separators into a single array.