on master help sign in
Move Streamly.String to Streamly.Data.String.
commitd26ab213645cb0a6d269dc7df87da65532975c72 authorPranay Sashank <pranaysashank@gmail.com> dateMon 12 Aug 2019, 09:52 (7 years ago) parent5b801ab
6 files changed+18−18
Changelog.md+5−5 benchmark/FileIO.hs+3−3 examples/FileSinkServer.hs+1−1 src/Streamly/String.hs → src/Streamly/Data/String.hs+2−2 streamly.cabal+1−1 test/String.hs+6−6
Changelog.md+5−5
@@ -22,12 +22,12 @@
2222 * `runN` has been replaced by `drainN`
2323 * `runWhile` has been replaced by `drainWhile`
2424 * `fromHandle` has been deprecated. Please use
25− `Streamly.FileSystem.Handle.read`, `Streamly.String.decodeUtf8` and
26− `Streamly.String.lines` to split the stream into lines. Use
27− `Streamly.String.foldLine` with `Streamly.Fold.toList` if you want to
25+ `Streamly.FileSystem.Handle.read`, `Streamly.Data.String.decodeUtf8` and
26+ `Streamly.Data.String.lines` to split the stream into lines. Use
27+ `Streamly.Data.String.foldLine` with `Streamly.Fold.toList` if you want to
2828 convert the stream to a stream of `String`.
2929 * `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
3131 `Streamly.FileSystem.Handle.write` for writing to a file handle.
3232 * Deprecate `scanx`, `foldx`, `foldxM`, `foldr1`
3333 * Remove deprecated APIs `scan`, `foldl`, `foldlM`
@@ -79,7 +79,7 @@ example, concat streams concurrently using this.
7979### Other Enhancements
8080
8181* 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
8383 character streams and other character stream operations.
8484 * _Arrays_: `Streamly.Memory.Array` module provides arrays for efficient
8585 in-memory buffering and efficient interfacing with IO.
benchmark/FileIO.hs+3−3
@@ -20,7 +20,7 @@ import qualified Streamly.Memory.Array as A
2020import qualified Streamly.Memory.ArrayStream as AS
2121import qualified Streamly.Prelude as S
2222import qualified Streamly.Fold as FL
23−import qualified Streamly.String as SS
23+import qualified Streamly.Data.String as SS
2424import qualified Streamly.Internal as Internal
2525
2626#ifdef DEVBUILD
@@ -99,8 +99,8 @@ main = do
9999 Handles inh _ <- readIORef href
100100 let s = FH.readArrays inh
101101 larr <- S.last s
102− case larr of
103− Nothing -> return Nothing
102+ return $ case larr of
103+ Nothing -> Nothing
104104 Just arr -> A.readIndex arr (A.length arr - 1)
105105 -- Note: this cannot be fairly compared with GNU wc -c or wc -m as
106106 -- wc uses lseek to just determine the file size rather than reading
examples/FileSinkServer.hs+1−1
@@ -8,7 +8,7 @@
88import System.Environment (getArgs)
99
1010import Streamly
11−import Streamly.String
11+import Streamly.Data.String
1212import qualified Streamly.FileSystem.Handle as FH
1313import qualified Streamly.Memory.Array as A
1414import qualified Streamly.Network.Socket as NS
src/Streamly/String.hs → src/Streamly/Data/String.hsrenamed+2−2
@@ -1,6 +1,6 @@
11{-# LANGUAGE FlexibleContexts #-}
22-- |
3−-- Module : Streamly.String
3+-- Module : Streamly.Data.String
44-- Copyright : (c) 2018 Composewell Technologies
55--
66-- License : BSD3
@@ -31,7 +31,7 @@
3131-- TBD write a note on performance comparison with text, bytestrings, lists and
3232-- vector.
3333--
34−module Streamly.String
34+module Streamly.Data.String
3535 (
3636 -- String
3737
streamly.cabal+1−1
@@ -230,7 +230,7 @@ library
230230 , Streamly
231231 , Streamly.Fold
232232
233− , Streamly.String
233+ , Streamly.Data.String
234234
235235 -- IO devices
236236 , Streamly.Memory.Array
test/String.hs+6−6
@@ -15,7 +15,7 @@ import Test.Hspec as H
1515import qualified Streamly.Memory.Array as A
1616import qualified Streamly.Memory.ArrayStream as AS
1717import qualified Streamly.Prelude as S
18−import qualified Streamly.String as SS
18+import qualified Streamly.Data.String as SS
1919
2020-- Coverage build takes too long with default number of tests
2121{-
@@ -101,12 +101,12 @@ main = hspec
101101 $ do
102102 describe "UTF8 - Encoding / Decoding" $ do
103103 prop "decodeUtf8 . encodeUtf8 == id" $ propDecodeEncodeId
104− prop "Streamly.String.lines == Prelude.lines" $ testLines
105− prop "Arrays Streamly.String.lines == Prelude.lines" $ testLinesArray
106− prop "Streamly.String.words == Prelude.words" $ testWords
104+ prop "Streamly.Data.String.lines == Prelude.lines" $ testLines
105+ prop "Arrays Streamly.Data.String.lines == Prelude.lines" $ testLinesArray
106+ prop "Streamly.Data.String.words == Prelude.words" $ testWords
107107 prop
108− "Streamly.String.unlines . Streamly.String.lines == unlines . lines"
108+ "Streamly.Data.String.unlines . Streamly.Data.String.lines == unlines . lines"
109109 $ testUnlines
110110 prop
111− "Streamly.String.unwords . Streamly.String.words == unwords . words"
111+ "Streamly.Data.String.unwords . Streamly.Data.String.words == unwords . words"
112112 $ testUnwords