@@ -1,3 +1,4 @@
2-- Module : Streamly.Internal.Unicode.Stream
3-- Module : Streamly.Internal.Unicode.Stream
3-- Copyright : (c) 2018 Composewell Technologies
4-- Copyright : (c) 2018 Composewell Technologies
@@ -11,6 +12,12 @@
12module Streamly.Internal.Unicode.Stream
13module Streamly.Internal.Unicode.Stream
16+ -- | To execute the code examples provided in this module in ghci, please
17+ -- run the following commands first.
14 -- * Construction (Decoding)
21 -- * Construction (Decoding)
15 decodeLatin1
22 decodeLatin1
@@ -122,14 +129,7 @@ import qualified Streamly.Internal.Data.Stream as D
123import Prelude hiding (lines, words, unlines, unwords)
130import Prelude hiding (lines, words, unlines, unwords)
125−-- $setup
132+#include "DocTestUnicodeStream.hs"
127−-- >>> :set -XMagicHash
128−-- >>> import Prelude hiding (lines, words, unlines, unwords)
129−-- >>> import qualified Streamly.Data.Stream as Stream
130−-- >>> import qualified Streamly.Data.Fold as Fold
131−-- >>> import qualified Streamly.Internal.Unicode.Stream as Unicode
132−-- >>> import Streamly.Internal.Unicode.Stream
134-------------------------------------------------------------------------------
134-------------------------------------------------------------------------------
135-- Latin1 decoding
135-- Latin1 decoding
@@ -1026,7 +1026,7 @@ stripHead = Stream.dropWhile isSpace
1026-- | Fold each line of the stream using the supplied 'Fold'
1026-- | Fold each line of the stream using the supplied 'Fold'
1027-- and stream the result.
1027-- and stream the result.
1029−-- >>> Stream.fold Fold.toList $ lines Fold.toList (Stream.fromList "lines\nthis\nstring\n\n\n")
1029+-- >>> Stream.fold Fold.toList $ Unicode.lines Fold.toList (Stream.fromList "lines\nthis\nstring\n\n\n")
1030-- ["lines","this","string","",""]
1030-- ["lines","this","string","",""]
1032-- > lines = Stream.splitOnSuffix (== '\n')
1032-- > lines = Stream.splitOnSuffix (== '\n')
@@ -1057,7 +1057,7 @@ isSpace c
1057-- | Fold each word of the stream using the supplied 'Fold'
1057-- | Fold each word of the stream using the supplied 'Fold'
1058-- and stream the result.
1058-- and stream the result.
1060−-- >>> Stream.fold Fold.toList $ words Fold.toList (Stream.fromList "fold these words")
1060+-- >>> Stream.fold Fold.toList $ Unicode.words Fold.toList (Stream.fromList "fold these words")
1061-- ["fold","these","words"]
1061-- ["fold","these","words"]
1063-- > words = Stream.wordsBy isSpace
1063-- > words = Stream.wordsBy isSpace