Bryan O'Sullivan  committed cac7a71

Fix the calculation of size when streaming lazy text

  • Participants
  • Parent commits d03a77d

Comments (0)

Files changed (1)

File Data/Text/Lazy/Fusion.hs

 import Prelude hiding (length)
 import qualified Data.Text.Fusion.Common as S
 import Data.Text.Fusion.Internal
-import Data.Text.Fusion.Size (isEmpty)
+import Data.Text.Fusion.Size (isEmpty, unknownSize)
 import Data.Text.Lazy.Internal
 import qualified Data.Text.Internal as I
 import qualified Data.Text.Array as A
 -- | /O(n)/ Convert a 'Text' into a 'Stream Char'.
 stream :: Text -> Stream Char
-stream text = Stream next (text :*: 0) 4 -- random HINT
+stream text = Stream next (text :*: 0) unknownSize
     next (Empty :*: _) = Done
     next (txt@(Chunk t@(I.Text _ _ len) ts) :*: i)