@@ -26,10 +26,10 @@ For an /efficient implementation of an encoding/,
2626'Builder's support (a) by providing an /O(1)/ concatentation operation
2727 and efficient implementations of basic encodings for 'Char's, 'Int's,
2828 and other standard Haskell values.
29- They support (b) by providing their result as a lazy 'L.ByteString ',
29+ They support (b) by providing their result as a 'L.LazyByteString ',
3030 which is internally just a linked list of pointers to /chunks/
3131 of consecutive raw memory.
32- Lazy 'L.ByteString 's can be efficiently consumed by functions that
32+ 'L.LazyByteString 's can be efficiently consumed by functions that
3333 write them to a file or send them over a network socket.
3434Note that each chunk boundary incurs expensive extra work (e.g., a system call)
3535 that must be amortized over the work spent on consuming the chunk body.
@@ -65,11 +65,11 @@ using some Unicode character encoding. However, this sacrifices performance
6565due to the intermediate 'String' representation being built and thrown away
6666right afterwards. We get rid of this intermediate 'String' representation by
6767fixing the character encoding to UTF-8 and using 'Builder's to convert
68- @Table@s directly to UTF-8 encoded CSV tables represented as lazy
69- 'L.ByteString 's.
68+ @Table@s directly to UTF-8 encoded CSV tables represented as
69+ 'L.LazyByteString 's.
7070
7171@
72- encodeUtf8CSV :: Table -> L.ByteString
72+ encodeUtf8CSV :: Table -> L.LazyByteString
7373encodeUtf8CSV = 'toLazyByteString' . renderTable
7474
7575renderTable :: Table -> Builder
@@ -114,7 +114,7 @@ table = [map StringC strings, map IntC [-3..3]]
114114@
115115
116116The expression @encodeUtf8CSV table@ results in the following lazy
117- 'L.ByteString '.
117+ 'L.LazyByteString '.
118118
119119>Chunk "\"hello\",\"\\\"1\\\"\",\"\206\187-w\195\182rld\"\n-3,-2,-1,0,1,2,3\n" Empty
120120
@@ -137,7 +137,7 @@ We use the @criterion@ library (<http://hackage.haskell.org/package/criterion>)
137137> ]
138138
139139On a Core2 Duo 2.20GHz on a 32-bit Linux,
140- the above code takes 1ms to generate the 22'500 bytes long lazy 'L.ByteString '.
140+ the above code takes 1ms to generate the 22'500 bytes long 'L.LazyByteString '.
141141Looking again at the definitions above,
142142 we see that we took care to avoid intermediate data structures,
143143 as otherwise we would sacrifice performance.
@@ -148,7 +148,7 @@ For example,
148148>renderRow = mconcat . intersperse (charUtf8 ',') . map renderCell
149149
150150Similarly, using /O(n)/ concatentations like '++' or the equivalent 'Data.ByteString.concat'
151- operations on strict and lazy 'L.ByteString 's should be avoided.
151+ operations on strict and 'L.LazyByteString 's should be avoided.
152152The following definition of @renderString@ is also about 20% slower.
153153
154154>renderString :: String -> Builder
@@ -264,11 +264,11 @@ import Foreign
264264import GHC.Base (unpackCString #, unpackCStringUtf8 #,
265265 unpackFoldrCString #, build )
266266
267- -- | Execute a 'Builder' and return the generated chunks as a lazy 'L.ByteString '.
268- -- The work is performed lazy, i.e., only when a chunk of the lazy 'L.ByteString '
267+ -- | Execute a 'Builder' and return the generated chunks as a 'L.LazyByteString '.
268+ -- The work is performed lazy, i.e., only when a chunk of the 'L.LazyByteString '
269269-- is forced.
270270{-# NOINLINE toLazyByteString #-} -- ensure code is shared
271- toLazyByteString :: Builder -> L. ByteString
271+ toLazyByteString :: Builder -> L. LazyByteString
272272toLazyByteString = toLazyByteStringWith
273273 (safeStrategy L. smallChunkSize L. defaultChunkSize) L. Empty
274274
0 commit comments