on master help sign in
Move Streamly.String to Streamly.Data.String.
d26ab21Pranay Sashank
Changelog.md+5−5
@@ -22,12 +22,12 @@
22 * `runN` has been replaced by `drainN`
22 * `runN` has been replaced by `drainN`
23 * `runWhile` has been replaced by `drainWhile`
23 * `runWhile` has been replaced by `drainWhile`
24 * `fromHandle` has been deprecated. Please use
24 * `fromHandle` has been deprecated. Please use
25− `Streamly.FileSystem.Handle.read`, `Streamly.String.decodeUtf8` and
25+ `Streamly.FileSystem.Handle.read`, `Streamly.Data.String.decodeUtf8` and
26− `Streamly.String.lines` to split the stream into lines. Use
26+ `Streamly.Data.String.lines` to split the stream into lines. Use
27− `Streamly.String.foldLine` with `Streamly.Fold.toList` if you want to
27+ `Streamly.Data.String.foldLine` with `Streamly.Fold.toList` if you want to
28 convert the stream to a stream of `String`.
28 convert the stream to a stream of `String`.
29 * `toHandle` has been deprecated. Please use `intersperse` and `concat` to
29 * `toHandle` has been deprecated. Please use `intersperse` and `concat` to
30− add newlines to a stream, `Streamly.String.encodeUtf8` for encoding and
30+ add newlines to a stream, `Streamly.Data.String.encodeUtf8` for encoding and
31 `Streamly.FileSystem.Handle.write` for writing to a file handle.
31 `Streamly.FileSystem.Handle.write` for writing to a file handle.
32 * Deprecate `scanx`, `foldx`, `foldxM`, `foldr1`
32 * Deprecate `scanx`, `foldx`, `foldxM`, `foldr1`
33 * Remove deprecated APIs `scan`, `foldl`, `foldlM`
33 * Remove deprecated APIs `scan`, `foldl`, `foldlM`
@@ -79,7 +79,7 @@ example, concat streams concurrently using this.
79### Other Enhancements
79### Other Enhancements
80
80
81* Add the following new features/modules:
81* Add the following new features/modules:
82− * _Unicode Strings_: `Streamly.String` module provides encoding/decoding of
82+ * _Unicode Strings_: `Streamly.Data.String` module provides encoding/decoding of
83 character streams and other character stream operations.
83 character streams and other character stream operations.
84 * _Arrays_: `Streamly.Memory.Array` module provides arrays for efficient
84 * _Arrays_: `Streamly.Memory.Array` module provides arrays for efficient
85 in-memory buffering and efficient interfacing with IO.
85 in-memory buffering and efficient interfacing with IO.
benchmark/FileIO.hs+3−3
@@ -20,7 +20,7 @@ import qualified Streamly.Memory.Array as A
20import qualified Streamly.Memory.ArrayStream as AS
20import qualified Streamly.Memory.ArrayStream as AS
21import qualified Streamly.Prelude as S
21import qualified Streamly.Prelude as S
22import qualified Streamly.Fold as FL
22import qualified Streamly.Fold as FL
23−import qualified Streamly.String as SS
23+import qualified Streamly.Data.String as SS
24import qualified Streamly.Internal as Internal
24import qualified Streamly.Internal as Internal
25
25
26#ifdef DEVBUILD
26#ifdef DEVBUILD
@@ -99,8 +99,8 @@ main = do
99 Handles inh _ <- readIORef href
99 Handles inh _ <- readIORef href
100 let s = FH.readArrays inh
100 let s = FH.readArrays inh
101 larr <- S.last s
101 larr <- S.last s
102− case larr of
102+ return $ case larr of
103− Nothing -> return Nothing
103+ Nothing -> Nothing
104 Just arr -> A.readIndex arr (A.length arr - 1)
104 Just arr -> A.readIndex arr (A.length arr - 1)
105 -- Note: this cannot be fairly compared with GNU wc -c or wc -m as
105 -- Note: this cannot be fairly compared with GNU wc -c or wc -m as
106 -- wc uses lseek to just determine the file size rather than reading
106 -- wc uses lseek to just determine the file size rather than reading
examples/FileSinkServer.hs+1−1
@@ -8,7 +8,7 @@
8import System.Environment (getArgs)
8import System.Environment (getArgs)
9
9
10import Streamly
10import Streamly
11−import Streamly.String
11+import Streamly.Data.String
12import qualified Streamly.FileSystem.Handle as FH
12import qualified Streamly.FileSystem.Handle as FH
13import qualified Streamly.Memory.Array as A
13import qualified Streamly.Memory.Array as A
14import qualified Streamly.Network.Socket as NS
14import qualified Streamly.Network.Socket as NS
src/Streamly/String.hs → src/Streamly/Data/String.hsrenamed+2−2
@@ -1,6 +1,6 @@
1{-# LANGUAGE FlexibleContexts #-}
1{-# LANGUAGE FlexibleContexts #-}
2-- |
2-- |
3−-- Module : Streamly.String
3+-- Module : Streamly.Data.String
4-- Copyright : (c) 2018 Composewell Technologies
4-- Copyright : (c) 2018 Composewell Technologies
5--
5--
6-- License : BSD3
6-- License : BSD3
@@ -31,7 +31,7 @@
31-- TBD write a note on performance comparison with text, bytestrings, lists and
31-- TBD write a note on performance comparison with text, bytestrings, lists and
32-- vector.
32-- vector.
33--
33--
34−module Streamly.String
34+module Streamly.Data.String
35 (
35 (
36 -- String
36 -- String
37
37
streamly.cabal+1−1
@@ -230,7 +230,7 @@ library
230 , Streamly
230 , Streamly
231 , Streamly.Fold
231 , Streamly.Fold
232
232
233− , Streamly.String
233+ , Streamly.Data.String
234
234
235 -- IO devices
235 -- IO devices
236 , Streamly.Memory.Array
236 , Streamly.Memory.Array
test/String.hs+6−6
@@ -15,7 +15,7 @@ import Test.Hspec as H
15import qualified Streamly.Memory.Array as A
15import qualified Streamly.Memory.Array as A
16import qualified Streamly.Memory.ArrayStream as AS
16import qualified Streamly.Memory.ArrayStream as AS
17import qualified Streamly.Prelude as S
17import qualified Streamly.Prelude as S
18−import qualified Streamly.String as SS
18+import qualified Streamly.Data.String as SS
19
19
20-- Coverage build takes too long with default number of tests
20-- Coverage build takes too long with default number of tests
21{-
21{-
@@ -101,12 +101,12 @@ main = hspec
101 $ do
101 $ do
102 describe "UTF8 - Encoding / Decoding" $ do
102 describe "UTF8 - Encoding / Decoding" $ do
103 prop "decodeUtf8 . encodeUtf8 == id" $ propDecodeEncodeId
103 prop "decodeUtf8 . encodeUtf8 == id" $ propDecodeEncodeId
104− prop "Streamly.String.lines == Prelude.lines" $ testLines
104+ prop "Streamly.Data.String.lines == Prelude.lines" $ testLines
105− prop "Arrays Streamly.String.lines == Prelude.lines" $ testLinesArray
105+ prop "Arrays Streamly.Data.String.lines == Prelude.lines" $ testLinesArray
106− prop "Streamly.String.words == Prelude.words" $ testWords
106+ prop "Streamly.Data.String.words == Prelude.words" $ testWords
107 prop
107 prop
108− "Streamly.String.unlines . Streamly.String.lines == unlines . lines"
108+ "Streamly.Data.String.unlines . Streamly.Data.String.lines == unlines . lines"
109 $ testUnlines
109 $ testUnlines
110 prop
110 prop
111− "Streamly.String.unwords . Streamly.String.words == unwords . words"
111+ "Streamly.Data.String.unwords . Streamly.Data.String.words == unwords . words"
112 $ testUnwords
112 $ testUnwords