on master help sign in
Move Streamly.Unicode to streamly-core
commit182edfd74f07da7a499fc4bc7649ec009400998a authorRanjeet Kumar Ranjan <ranjeetr@composewell.com> dateThu 22 Sep 2022, 17:30 (4 years ago) parent5868fc9
9 files changed+82−83
.hlint.ignore+1−1 cabal.project.packdiff+1−1 src/Streamly/Internal/Unicode/Array/Char.hs → core/src/Streamly/Internal/Unicode/Array/Char.hs+6−7 src/Streamly/Internal/Unicode/Char/Parser.hs → core/src/Streamly/Internal/Unicode/Char/Parser.hs src/Streamly/Internal/Unicode/Stream.hs → core/src/Streamly/Internal/Unicode/Stream.hs+58−64 src/Streamly/Internal/Unicode/String.hs → core/src/Streamly/Internal/Unicode/String.hs+1−1 src/Streamly/Unicode/Stream.hs → core/src/Streamly/Unicode/Stream.hs core/streamly-core.cabal+10 streamly.cabal+5−9
.hlint.ignore+1−1
@@ -1,7 +1,7 @@
11core/src/Streamly/Internal/Data/Stream/StreamK/Type.hs
22core/src/Streamly/Internal/Data/Pipe/Type.hs
3+core/src/Streamly/Internal/Unicode/Stream.hs
34src/Streamly/Internal/Data/SmallArray/Type.hs
4−src/Streamly/Internal/Unicode/Stream.hs
55test/Streamly/Test/Data/Array.hs
66test/Streamly/Test/Data/Parser.hs
77test/Streamly/Test/Data/Parser/ParserD.hs
cabal.project.packdiff+1−1
@@ -5,7 +5,7 @@ packages:
55source-repository-package
66 type: git
77 location: https://github.com/composewell/packdiff.git
8− tag: 45cdca157e7159b8dd4261b3616fe7fa4200b967
8+ tag: 8b5d35b72b8ba3c9fb34f16e30d9d58f22b78f3e
99
1010source-repository-package
1111 type: git
src/Streamly/Internal/Unicode/Array/Char.hs → core/src/Streamly/Internal/Unicode/Array/Char.hsrenamed+6−7
@@ -18,9 +18,8 @@ module Streamly.Internal.Unicode.Array.Char
1818where
1919
2020import Control.Monad.IO.Class (MonadIO)
21−import Streamly.Data.Array.Unboxed (Array)
22−import Streamly.Internal.Data.Stream.IsStream (IsStream)
23−import Streamly.Prelude (MonadAsync)
21+import Streamly.Data.Stream (Stream)
22+import Streamly.Internal.Data.Array.Unboxed (Array)
2423
2524import qualified Streamly.Data.Array.Unboxed as A
2625import qualified Streamly.Internal.Unicode.Stream as S
@@ -43,7 +42,7 @@ import Prelude hiding (String, lines, words, unlines, unwords)
4342-- ["lines","this","string","",""]
4443--
4544{-# INLINE lines #-}
46−lines :: (MonadIO m, IsStream t) => t m Char -> t m (Array Char)
45+lines :: (MonadIO m) => Stream m Char -> Stream m (Array Char)
4746lines = S.lines A.write
4847
4948-- | Break a string up into a stream of strings, which were delimited
@@ -55,7 +54,7 @@ lines = S.lines A.write
5554-- ["A","newline","is","considered","white","space?"]
5655--
5756{-# INLINE words #-}
58−words :: (MonadIO m, IsStream t) => t m Char -> t m (Array Char)
57+words :: (MonadIO m) => Stream m Char -> Stream m (Array Char)
5958words = S.words A.write
6059
6160-- | Flattens the stream of @Array Char@, after appending a terminating
@@ -72,7 +71,7 @@ words = S.words A.write
7271--
7372-- > unlines . lines /= id
7473{-# INLINE unlines #-}
75−unlines :: (MonadIO m, IsStream t) => t m (Array Char) -> t m Char
74+unlines :: (MonadIO m) => Stream m (Array Char) -> Stream m Char
7675unlines = S.unlines A.read
7776
7877-- | Flattens the stream of @Array Char@, after appending a separating
@@ -89,5 +88,5 @@ unlines = S.unlines A.read
8988--
9089-- > unwords . words /= id
9190{-# INLINE unwords #-}
92−unwords :: (MonadAsync m, IsStream t) => t m (Array Char) -> t m Char
91+unwords :: (MonadIO m) => Stream m (Array Char) -> Stream m Char
9392unwords = S.unwords A.read
src/Streamly/Internal/Unicode/Char/Parser.hs → core/src/Streamly/Internal/Unicode/Char/Parser.hsrenamed

The content is the same.

src/Streamly/Internal/Unicode/Stream.hs → core/src/Streamly/Internal/Unicode/Stream.hsrenamed+58−64
@@ -103,14 +103,12 @@ import GHC.Exts (Addr#)
103103import GHC.IO.Encoding.Failure (isSurrogate)
104104import GHC.Ptr (Ptr (..), plusPtr)
105105import System.IO.Unsafe (unsafePerformIO)
106−import Streamly.Internal.Data.Array.Unboxed (Array)
106+import Streamly.Internal.Data.Array.Unboxed.Type (Array(..))
107107import Streamly.Internal.Data.Array.Unboxed.Mut.Type (MutableByteArray)
108108import Streamly.Internal.Data.Fold (Fold)
109−import Streamly.Internal.Data.Stream.IsStream.Type
110− (IsStream, fromStreamD, toStreamD, adapt)
111−import Streamly.Internal.Data.Stream (Stream)
109+import Streamly.Internal.Data.Stream (Stream, fromStreamD, toStreamD)
112110import Streamly.Internal.Data.Stream.StreamD (Step (..))
113−import Streamly.Internal.Data.SVar (adaptState)
111+import Streamly.Internal.Data.SVar.Type (adaptState)
114112import Streamly.Internal.Data.Tuple.Strict (Tuple'(..))
115113import Streamly.Internal.Data.Unboxed (peekWith)
116114import Streamly.Internal.Data.Unfold.Type (Unfold(..))
@@ -118,14 +116,10 @@ import Streamly.Internal.System.IO (unsafeInlineIO)
118116
119117import qualified Streamly.Data.Fold as Fold
120118import qualified Streamly.Data.Unfold as Unfold
119+import qualified Streamly.Internal.Data.Array.Unboxed.Type as Array
121120import qualified Streamly.Internal.Data.Parser as Parser (Parser)
122121import qualified Streamly.Internal.Data.Parser.ParserD as ParserD
123− (Parser(..), Step(..), Initial(..), toParserK, toFold)
124−import qualified Streamly.Internal.Data.Stream as Stream (fromByteStr#)
125−import qualified Streamly.Internal.Data.Stream.Serial as Serial
126−import qualified Streamly.Data.Array.Unboxed as Array
127−import qualified Streamly.Internal.Data.Array.Unboxed.Type as A (Array (..))
128−import qualified Streamly.Internal.Data.Stream.IsStream as S
122+import qualified Streamly.Internal.Data.Stream as Stream
129123import qualified Streamly.Internal.Data.Stream.StreamD as D
130124
131125import Prelude hiding (lines, words, unlines, unwords)
@@ -150,8 +144,8 @@ import Prelude hiding (lines, words, unlines, unwords)
150144--
151145-- @since 0.8.0
152146{-# INLINE decodeLatin1 #-}
153−decodeLatin1 :: (IsStream t, Monad m) => t m Word8 -> t m Char
154−decodeLatin1 = S.map (unsafeChr . fromIntegral)
147+decodeLatin1 :: (Monad m) => Stream m Word8 -> Stream m Char
148+decodeLatin1 = fmap (unsafeChr . fromIntegral)
155149
156150-------------------------------------------------------------------------------
157151-- Latin1 encoding
@@ -163,8 +157,8 @@ decodeLatin1 = S.map (unsafeChr . fromIntegral)
163157--
164158-- @since 0.8.0
165159{-# INLINE encodeLatin1' #-}
166−encodeLatin1' :: (IsStream t, Monad m) => t m Char -> t m Word8
167−encodeLatin1' = S.map convert
160+encodeLatin1' :: (Monad m) => Stream m Char -> Stream m Word8
161+encodeLatin1' = fmap convert
168162 where
169163 convert c =
170164 let codepoint = ord c
@@ -185,21 +179,21 @@ encodeLatin1' = S.map convert
185179--
186180-- /Since: 0.8.0 (Lenient Behaviour)/
187181{-# INLINE encodeLatin1 #-}
188−encodeLatin1 :: (IsStream t, Monad m) => t m Char -> t m Word8
189−encodeLatin1 = S.map (fromIntegral . ord)
182+encodeLatin1 :: (Monad m) => Stream m Char -> Stream m Word8
183+encodeLatin1 = fmap (fromIntegral . ord)
190184
191185-- | Like 'encodeLatin1' but drops the input characters beyond 255.
192186--
193187-- @since 0.8.0
194188{-# INLINE encodeLatin1_ #-}
195−encodeLatin1_ :: (IsStream t, Monad m) => t m Char -> t m Word8
196−encodeLatin1_ = S.map (fromIntegral . ord) . S.filter (<= chr 255)
189+encodeLatin1_ :: (Monad m) => Stream m Char -> Stream m Word8
190+encodeLatin1_ = fmap (fromIntegral . ord) . Stream.filter (<= chr 255)
197191
198192-- | Same as 'encodeLatin1'
199193--
200194{-# DEPRECATED encodeLatin1Lax "Please use 'encodeLatin1' instead" #-}
201195{-# INLINE encodeLatin1Lax #-}
202−encodeLatin1Lax :: (IsStream t, Monad m) => t m Char -> t m Word8
196+encodeLatin1Lax :: (Monad m) => Stream m Char -> Stream m Word8
203197encodeLatin1Lax = encodeLatin1
204198
205199-------------------------------------------------------------------------------
@@ -430,8 +424,8 @@ decodeUtf8EitherD = resumeDecodeUtf8EitherD 0 0
430424--
431425-- /Pre-release/
432426{-# INLINE decodeUtf8Either #-}
433−decodeUtf8Either :: (Monad m, IsStream t)
434− => t m Word8 -> t m (Either DecodeError Char)
427+decodeUtf8Either :: (Monad m)
428+ => Stream m Word8 -> Stream m (Either DecodeError Char)
435429decodeUtf8Either = fromStreamD . decodeUtf8EitherD . toStreamD
436430
437431-- |
@@ -439,11 +433,11 @@ decodeUtf8Either = fromStreamD . decodeUtf8EitherD . toStreamD
439433-- /Pre-release/
440434{-# INLINE resumeDecodeUtf8Either #-}
441435resumeDecodeUtf8Either
442− :: (Monad m, IsStream t)
436+ :: (Monad m)
443437 => DecodeState
444438 -> CodePoint
445− -> t m Word8
446− -> t m (Either DecodeError Char)
439+ -> Stream m Word8
440+ -> Stream m (Either DecodeError Char)
447441resumeDecodeUtf8Either st cp =
448442 fromStreamD . resumeDecodeUtf8EitherD st cp . toStreamD
449443
@@ -663,7 +657,7 @@ decodeUtf8D = decodeUtf8WithD TransliterateCodingFailure
663657--
664658-- /Since: 0.8.0 (Lenient Behaviour)/
665659{-# INLINE decodeUtf8 #-}
666−decodeUtf8 :: (Monad m, IsStream t) => t m Word8 -> t m Char
660+decodeUtf8 :: (Monad m) => Stream m Word8 -> Stream m Char
667661decodeUtf8 = fromStreamD . decodeUtf8D . toStreamD
668662
669663{-# INLINE decodeUtf8D' #-}
@@ -675,7 +669,7 @@ decodeUtf8D' = decodeUtf8WithD ErrorOnCodingFailure
675669--
676670-- @since 0.8.0
677671{-# INLINE decodeUtf8' #-}
678−decodeUtf8' :: (Monad m, IsStream t) => t m Word8 -> t m Char
672+decodeUtf8' :: (Monad m) => Stream m Word8 -> Stream m Char
679673decodeUtf8' = fromStreamD . decodeUtf8D' . toStreamD
680674
681675{-# INLINE decodeUtf8D_ #-}
@@ -687,14 +681,14 @@ decodeUtf8D_ = decodeUtf8WithD DropOnCodingFailure
687681--
688682-- @since 0.8.0
689683{-# INLINE decodeUtf8_ #-}
690−decodeUtf8_ :: (Monad m, IsStream t) => t m Word8 -> t m Char
684+decodeUtf8_ :: (Monad m) => Stream m Word8 -> Stream m Char
691685decodeUtf8_ = fromStreamD . decodeUtf8D_ . toStreamD
692686
693687-- | Same as 'decodeUtf8'
694688--
695689{-# DEPRECATED decodeUtf8Lax "Please use 'decodeUtf8' instead" #-}
696690{-# INLINE decodeUtf8Lax #-}
697−decodeUtf8Lax :: (IsStream t, Monad m) => t m Word8 -> t m Char
691+decodeUtf8Lax :: (Monad m) => Stream m Word8 -> Stream m Char
698692decodeUtf8Lax = decodeUtf8
699693
700694-------------------------------------------------------------------------------
@@ -726,7 +720,7 @@ data FlattenState s a
726720decodeUtf8ArraysWithD ::
727721 MonadIO m
728722 => CodingFailureMode
729− -> D.Stream m (A.Array Word8)
723+ -> D.Stream m (Array Word8)
730724 -> D.Stream m Char
731725decodeUtf8ArraysWithD cfm (D.Stream step state) =
732726 D.Stream (step' utf8d) (OuterLoop state Nothing)
@@ -751,7 +745,7 @@ decodeUtf8ArraysWithD cfm (D.Stream step state) =
751745 r <- step (adaptState gst) st
752746 return $
753747 case r of
754− Yield A.Array {..} s ->
748+ Yield Array {..} s ->
755749 Skip (InnerLoopDecodeInit s arrContents arrStart arrEnd)
756750 Skip s -> Skip (OuterLoop s Nothing)
757751 Stop -> Skip D
@@ -759,7 +753,7 @@ decodeUtf8ArraysWithD cfm (D.Stream step state) =
759753 r <- step (adaptState gst) st
760754 return $
761755 case r of
762− Yield A.Array {..} s ->
756+ Yield Array {..} s ->
763757 Skip (InnerLoopDecoding s arrContents arrStart arrEnd ds cp)
764758 Skip s -> Skip (OuterLoop s dst)
765759 Stop -> Skip inputUnderflow
@@ -828,7 +822,7 @@ decodeUtf8ArraysWithD cfm (D.Stream step state) =
828822{-# INLINE decodeUtf8ArraysD #-}
829823decodeUtf8ArraysD ::
830824 MonadIO m
831− => D.Stream m (A.Array Word8)
825+ => D.Stream m (Array Word8)
832826 -> D.Stream m Char
833827decodeUtf8ArraysD = decodeUtf8ArraysWithD TransliterateCodingFailure
834828
@@ -837,14 +831,14 @@ decodeUtf8ArraysD = decodeUtf8ArraysWithD TransliterateCodingFailure
837831-- /Pre-release/
838832{-# INLINE decodeUtf8Arrays #-}
839833decodeUtf8Arrays ::
840− (MonadIO m, IsStream t) => t m (Array Word8) -> t m Char
834+ (MonadIO m) => Stream m (Array Word8) -> Stream m Char
841835decodeUtf8Arrays =
842836 fromStreamD . decodeUtf8ArraysD . toStreamD
843837
844838{-# INLINE decodeUtf8ArraysD' #-}
845839decodeUtf8ArraysD' ::
846840 MonadIO m
847− => D.Stream m (A.Array Word8)
841+ => D.Stream m (Array Word8)
848842 -> D.Stream m Char
849843decodeUtf8ArraysD' = decodeUtf8ArraysWithD ErrorOnCodingFailure
850844
@@ -852,13 +846,13 @@ decodeUtf8ArraysD' = decodeUtf8ArraysWithD ErrorOnCodingFailure
852846--
853847-- /Pre-release/
854848{-# INLINE decodeUtf8Arrays' #-}
855−decodeUtf8Arrays' :: (MonadIO m, IsStream t) => t m (Array Word8) -> t m Char
849+decodeUtf8Arrays' :: (MonadIO m) => Stream m (Array Word8) -> Stream m Char
856850decodeUtf8Arrays' = fromStreamD . decodeUtf8ArraysD' . toStreamD
857851
858852{-# INLINE decodeUtf8ArraysD_ #-}
859853decodeUtf8ArraysD_ ::
860854 MonadIO m
861− => D.Stream m (A.Array Word8)
855+ => D.Stream m (Array Word8)
862856 -> D.Stream m Char
863857decodeUtf8ArraysD_ = decodeUtf8ArraysWithD DropOnCodingFailure
864858
@@ -867,7 +861,7 @@ decodeUtf8ArraysD_ = decodeUtf8ArraysWithD DropOnCodingFailure
867861-- /Pre-release/
868862{-# INLINE decodeUtf8Arrays_ #-}
869863decodeUtf8Arrays_ ::
870− (MonadIO m, IsStream t) => t m (Array Word8) -> t m Char
864+ (MonadIO m) => Stream m (Array Word8) -> Stream m Char
871865decodeUtf8Arrays_ =
872866 fromStreamD . decodeUtf8ArraysD_ . toStreamD
873867
@@ -943,7 +937,7 @@ encodeUtf8D' = D.unfoldMany readCharUtf8'
943937--
944938-- @since 0.8.0
945939{-# INLINE encodeUtf8' #-}
946−encodeUtf8' :: (Monad m, IsStream t) => t m Char -> t m Word8
940+encodeUtf8' :: (Monad m) => Stream m Char -> Stream m Word8
947941encodeUtf8' = fromStreamD . encodeUtf8D' . toStreamD
948942
949943{-# INLINE_NORMAL readCharUtf8 #-}
@@ -965,7 +959,7 @@ encodeUtf8D = D.unfoldMany readCharUtf8
965959--
966960-- /Since: 0.8.0 (Lenient Behaviour)/
967961{-# INLINE encodeUtf8 #-}
968−encodeUtf8 :: (Monad m, IsStream t) => t m Char -> t m Word8
962+encodeUtf8 :: (Monad m) => Stream m Char -> Stream m Word8
969963encodeUtf8 = fromStreamD . encodeUtf8D . toStreamD
970964
971965{-# INLINE_NORMAL readCharUtf8_ #-}
@@ -981,14 +975,14 @@ encodeUtf8D_ = D.unfoldMany readCharUtf8_
981975--
982976-- @since 0.8.0
983977{-# INLINE encodeUtf8_ #-}
984−encodeUtf8_ :: (Monad m, IsStream t) => t m Char -> t m Word8
978+encodeUtf8_ :: (Monad m) => Stream m Char -> Stream m Word8
985979encodeUtf8_ = fromStreamD . encodeUtf8D_ . toStreamD
986980
987981-- | Same as 'encodeUtf8'
988982--
989983{-# DEPRECATED encodeUtf8Lax "Please use 'encodeUtf8' instead" #-}
990984{-# INLINE encodeUtf8Lax #-}
991−encodeUtf8Lax :: (IsStream t, Monad m) => t m Char -> t m Word8
985+encodeUtf8Lax :: (Monad m) => Stream m Char -> Stream m Word8
992986encodeUtf8Lax = encodeUtf8
993987
994988-------------------------------------------------------------------------------
@@ -1024,27 +1018,27 @@ encodeObject :: MonadIO m =>
10241018 -> Unfold m a Char
10251019 -> a
10261020 -> m (Array Word8)
1027−encodeObject encode u = S.fold Array.write . encode . S.unfold u
1021+encodeObject encode u = Stream.fold Array.write . encode . Stream.unfold u
10281022
10291023-- | Encode a stream of container objects using the supplied encoding scheme.
10301024-- Each object is encoded as an @Array Word8@.
10311025--
10321026-- /Internal/
10331027{-# INLINE encodeObjects #-}
1034−encodeObjects :: (MonadIO m, IsStream t) =>
1028+encodeObjects :: (MonadIO m) =>
10351029 (Stream m Char -> Stream m Word8)
10361030 -> Unfold m a Char
1037− -> t m a
1038− -> t m (Array Word8)
1039−encodeObjects encode u = adapt . Serial.mapM (encodeObject encode u) . adapt
1031+ -> Stream m a
1032+ -> Stream m (Array Word8)
1033+encodeObjects encode u = Stream.mapM (encodeObject encode u)
10401034
10411035-- | Encode a stream of 'String' using the supplied encoding scheme. Each
10421036-- string is encoded as an @Array Word8@.
10431037--
10441038-- @since 0.8.0
10451039{-# INLINE encodeStrings #-}
1046−encodeStrings :: (MonadIO m, IsStream t) =>
1047− (Stream m Char -> Stream m Word8) -> t m String -> t m (Array Word8)
1040+encodeStrings :: (MonadIO m) =>
1041+ (Stream m Char -> Stream m Word8) -> Stream m String -> Stream m (Array Word8)
10481042encodeStrings encode = encodeObjects encode Unfold.fromList
10491043
10501044{-
@@ -1052,21 +1046,21 @@ encodeStrings encode = encodeObjects encode Unfold.fromList
10521046-- Utility operations on strings
10531047-------------------------------------------------------------------------------
10541048
1055−strip :: IsStream t => t m Char -> t m Char
1049+strip :: IsStream t => Stream m Char -> Stream m Char
10561050strip = undefined
10571051
1058−stripTail :: IsStream t => t m Char -> t m Char
1052+stripTail :: IsStream t => Stream m Char -> Stream m Char
10591053stripTail = undefined
10601054-}
10611055
10621056-- | Remove leading whitespace from a string.
10631057--
1064−-- > stripHead = S.dropWhile isSpace
1058+-- > stripHead = Stream.dropWhile isSpace
10651059--
10661060-- /Pre-release/
10671061{-# INLINE stripHead #-}
1068−stripHead :: (Monad m, IsStream t) => t m Char -> t m Char
1069−stripHead = S.dropWhile isSpace
1062+stripHead :: (Monad m) => Stream m Char -> Stream m Char
1063+stripHead = Stream.dropWhile isSpace
10701064
10711065-- | Fold each line of the stream using the supplied 'Fold'
10721066-- and stream the result.
@@ -1074,12 +1068,12 @@ stripHead = S.dropWhile isSpace
10741068-- >>> Stream.toList $ lines Fold.toList (Stream.fromList "lines\nthis\nstring\n\n\n")
10751069-- ["lines","this","string","",""]
10761070--
1077−-- > lines = S.splitOnSuffix (== '\n')
1071+-- > lines = Stream.splitOnSuffix (== '\n')
10781072--
10791073-- /Pre-release/
10801074{-# INLINE lines #-}
1081−lines :: (Monad m, IsStream t) => Fold m Char b -> t m Char -> t m b
1082−lines = S.splitOnSuffix (== '\n')
1075+lines :: (Monad m) => Fold m Char b -> Stream m Char -> Stream m b
1076+lines f = Stream.foldMany (Fold.takeEndBy_ (== '\n') f)
10831077
10841078#if !MIN_VERSION_base(4,17,0)
10851079foreign import ccall unsafe "u_iswspace"
@@ -1105,12 +1099,12 @@ isSpace c
11051099-- >>> Stream.toList $ words Fold.toList (Stream.fromList "fold these words")
11061100-- ["fold","these","words"]
11071101--
1108−-- > words = S.wordsBy isSpace
1102+-- > words = Stream.wordsBy isSpace
11091103--
11101104-- /Pre-release/
11111105{-# INLINE words #-}
1112−words :: (Monad m, IsStream t) => Fold m Char b -> t m Char -> t m b
1113−words = S.wordsBy isSpace
1106+words :: (Monad m) => Fold m Char b -> Stream m Char -> Stream m b
1107+words f m = Stream.fromStreamD $ D.wordsBy isSpace f (Stream.toStreamD m)
11141108
11151109-- | Unfold a stream to character streams using the supplied 'Unfold'
11161110-- and concat the results suffixing a newline character @\\n@ to each stream.
@@ -1122,8 +1116,8 @@ words = S.wordsBy isSpace
11221116--
11231117-- /Pre-release/
11241118{-# INLINE unlines #-}
1125−unlines :: (MonadIO m, IsStream t) => Unfold m a Char -> t m a -> t m Char
1126−unlines = S.interposeSuffix '\n'
1119+unlines :: (MonadIO m) => Unfold m a Char -> Stream m a -> Stream m Char
1120+unlines = Stream.interposeSuffix '\n'
11271121
11281122-- | Unfold the elements of a stream to character streams using the supplied
11291123-- 'Unfold' and concat the results with a whitespace character infixed between
@@ -1136,5 +1130,5 @@ unlines = S.interposeSuffix '\n'
11361130--
11371131-- /Pre-release/
11381132{-# INLINE unwords #-}
1139−unwords :: (MonadIO m, IsStream t) => Unfold m a Char -> t m a -> t m Char
1140−unwords = S.interpose ' '
1133+unwords :: (MonadIO m) => Unfold m a Char -> Stream m a -> Stream m Char
1134+unwords = Stream.interpose ' '
src/Streamly/Internal/Unicode/String.hs → core/src/Streamly/Internal/Unicode/String.hsrenamed+1−1
@@ -44,7 +44,7 @@ import Language.Haskell.TH.Quote
4444import qualified Streamly.Data.Fold as Fold
4545import qualified Streamly.Internal.Data.Parser as Parser
4646 (some, many, takeWhile1)
47−import qualified Streamly.Internal.Data.Stream.IsStream as Stream
47+import qualified Streamly.Data.Stream as Stream (fromList, parse)
4848import qualified Streamly.Internal.Unicode.Char.Parser as Parser
4949
5050-- $setup
src/Streamly/Unicode/Stream.hs → core/src/Streamly/Unicode/Stream.hsrenamed

The content is the same.

core/streamly-core.cabal+10
@@ -326,6 +326,12 @@ library
326326 , Streamly.Internal.Data.Array.Stream.Fold.Foreign
327327
328328 , Streamly.Internal.Data.Array.Stream.Foreign
329+
330+ -- streamly-unicode
331+ , Streamly.Internal.Unicode.Stream
332+ , Streamly.Internal.Unicode.String
333+ , Streamly.Internal.Unicode.Char.Parser
334+ , Streamly.Internal.Unicode.Array.Char
329335
330336 -- Ring Arrays
331337 , Streamly.Internal.Data.Ring.Foreign
@@ -344,6 +350,9 @@ library
344350 , Streamly.Data.Array.Unboxed
345351 , Streamly.Data.Array.Unboxed.Mut
346352
353+ -- Text Processing
354+ , Streamly.Unicode.Stream
355+
347356 if flag(dev)
348357 exposed-modules:
349358 Streamly.Internal.Data.Stream.StreamDK
@@ -363,6 +372,7 @@ library
363372 , ghc-prim >= 0.2 && < 0.10
364373 , mtl >= 2.2 && < 2.3
365374 , transformers >= 0.4 && < 0.7
375+ , template-haskell >= 2.13 && < 2.20
366376
367377 , fusion-plugin-types >= 0.1 && < 0.2
368378
streamly.cabal+5−9
@@ -221,6 +221,11 @@ extra-source-files:
221221 core/src/Streamly/Data/Array/Unboxed/Mut.hs
222222 core/src/Streamly/Internal/Data/Time/Clock/Darwin.c
223223 core/src/Streamly/Internal/Data/Time/Clock/Windows.c
224+ core/src/Streamly/Internal/Unicode/Array/Char.hs
225+ core/src/Streamly/Internal/Unicode/Char/Parser.hs
226+ core/src/Streamly/Internal/Unicode/Stream.hs
227+ core/src/Streamly/Internal/Unicode/String.hs
228+ core/src/Streamly/Unicode/Stream.hs
224229 core/streamly-core.cabal
225230 core/jsbits/clock.js
226231 core/Setup.hs
@@ -482,12 +487,8 @@ library
482487 , Streamly.Internal.Data.Binary.Decode
483488
484489 -- streamly-unicode
485− , Streamly.Internal.Unicode.Stream
486− , Streamly.Internal.Unicode.String
487490 , Streamly.Internal.Unicode.Utf8
488491 , Streamly.Internal.Unicode.Char
489− , Streamly.Internal.Unicode.Char.Parser
490− , Streamly.Internal.Unicode.Array.Char
491492
492493 -- streamly-filesystem
493494 , Streamly.Internal.FileSystem.Handle
@@ -504,9 +505,6 @@ library
504505 -- Exposed modules
505506 , Streamly.Prelude
506507
507− -- Text Processing
508− , Streamly.Unicode.Stream
509−
510508 -- Filesystem/IO
511509 , Streamly.FileSystem.Handle
512510 , Streamly.Console.Stdio
@@ -573,13 +571,11 @@ library
573571 , ghc-prim >= 0.2 && < 0.10
574572 , mtl >= 2.2 && < 2.4
575573 , transformers >= 0.4 && < 0.7
576− , template-haskell >= 2.13 && < 2.20
577574
578575 , monad-control
579576
580577 -- The core streamly package
581578 , streamly-core == 0.1.0
582− , fusion-plugin-types >= 0.1 && < 0.2
583579
584580 , hashable >= 1.3 && < 1.5
585581 , unordered-containers >= 0.2 && < 0.3