@@ -1,3 +1,4 @@
1+{-# LANGUAGE CPP #-}
12-- |
23-- Module : Streamly.Internal.Unicode.Stream
34-- Copyright : (c) 2018 Composewell Technologies
@@ -11,6 +12,12 @@
1112
1213module Streamly.Internal.Unicode.Stream
1314 (
15+ -- * Setup
16+ -- | To execute the code examples provided in this module in ghci, please
17+ -- run the following commands first.
18+ --
19+ -- $setup
20+
1421 -- * Construction (Decoding)
1522 decodeLatin1
1623
@@ -122,14 +129,7 @@ import qualified Streamly.Internal.Data.Stream as D
122129
123130import Prelude hiding (lines, words, unlines, unwords)
124131
125−-- $setup
126−-- >>> :m
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
132+#include "DocTestUnicodeStream.hs"
133133
134134-------------------------------------------------------------------------------
135135-- Latin1 decoding
@@ -1026,7 +1026,7 @@ stripHead = Stream.dropWhile isSpace
10261026-- | Fold each line of the stream using the supplied 'Fold'
10271027-- and stream the result.
10281028--
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")
10301030-- ["lines","this","string","",""]
10311031--
10321032-- > lines = Stream.splitOnSuffix (== '\n')
@@ -1057,7 +1057,7 @@ isSpace c
10571057-- | Fold each word of the stream using the supplied 'Fold'
10581058-- and stream the result.
10591059--
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")
10611061-- ["fold","these","words"]
10621062--
10631063-- > words = Stream.wordsBy isSpace