@@ -83,8 +83,7 @@ module Network.Wai
8383 , modifyResponse
8484 ) where
8585
86−import Blaze.ByteString.Builder (Builder, fromLazyByteString)
87−import Blaze.ByteString.Builder (fromByteString)
86+import Data.ByteString.Builder (Builder, byteString, lazyByteString)
8887import Control.Monad (unless)
8988import qualified Data.ByteString as B
9089import qualified Data.ByteString.Lazy as L
@@ -134,7 +133,7 @@ responseBuilder = ResponseBuilder
134133-- | Creating 'Response' from 'L.ByteString'. This is a wrapper for
135134-- 'responseBuilder'.
136135responseLBS :: H.Status -> H.ResponseHeaders -> L.ByteString -> Response
137−responseLBS s h = ResponseBuilder s h . fromLazyByteString
136+responseLBS s h = ResponseBuilder s h . lazyByteString
138137
139138-- | Creating 'Response' from a stream of values.
140139--
@@ -148,9 +147,9 @@ responseLBS s h = ResponseBuilder s h . fromLazyByteString
148147-- (putStrLn \"Allocating scarce resource\")
149148-- (putStrLn \"Cleaning up\")
150149-- $ respond $ responseStream status200 [] $ \\write flush -> do
151−-- write $ fromByteString \"Hello\\n\"
150+-- write $ byteString \"Hello\\n\"
152151-- flush
153−-- write $ fromByteString \"World\\n\"
152+-- write $ byteString \"World\\n\"
154153-- @
155154--
156155-- Note that in some cases you can use @bracket@ from inside @responseStream@
@@ -213,7 +212,7 @@ responseToStream (ResponseFile s h fp (Just part)) =
213212 bs <- B.hGetSome handle defaultChunkSize
214213 unless (B.null bs) $ do
215214 let x = B.take remaining bs
216− sendChunk $ fromByteString x
215+ sendChunk $ byteString x
217216 loop $ remaining - B.length x
218217 loop $ fromIntegral $ filePartByteCount part
219218 )
@@ -224,7 +223,7 @@ responseToStream (ResponseFile s h fp Nothing) =
224223 withBody $ \sendChunk _flush -> fix $ \loop -> do
225224 bs <- B.hGetSome handle defaultChunkSize
226225 unless (B.null bs) $ do
227− sendChunk $ fromByteString bs
226+ sendChunk $ byteString bs
228227 loop
229228 )
230229responseToStream (ResponseBuilder s h b) =