on master help sign in
Naming consistency: send -> write
0c601acAndrew Pritchard
wai/Network/Wai/HTTP2.hs+6−7
@@ -7,8 +7,8 @@ module Network.Wai.HTTP2
7 , Responder
7 , Responder
8 , Trailers
8 , Trailers
9 , promiseHeaders
9 , promiseHeaders
10− , sendBuilder
10+ , writeBuilder
11− , sendFilePart
11+ , writeFilePart
12 ) where
12 ) where
13
13
14import Data.ByteString (ByteString)
14import Data.ByteString (ByteString)
@@ -38,15 +38,14 @@ type HTTP2Application = Request -> PushFunc -> Responder
38-- | Part of a streaming response -- either a 'Builder' or a range of a file.
38-- | Part of a streaming response -- either a 'Builder' or a range of a file.
39data Chunk = FileChunk FilePath (Maybe FilePart) | BuilderChunk Builder
39data Chunk = FileChunk FilePath (Maybe FilePart) | BuilderChunk Builder
40
40
41−-- TODO send -> write
42-- | Given the write function of a stream body, write the given 'Builder'.
41-- | Given the write function of a stream body, write the given 'Builder'.
43−sendBuilder :: (Chunk -> IO ()) -> Builder -> IO ()
42+writeBuilder :: (Chunk -> IO ()) -> Builder -> IO ()
44−sendBuilder = (. BuilderChunk)
43+writeBuilder = (. BuilderChunk)
45
44
46-- | Given the write function of a stream body, write part or all of the given
45-- | Given the write function of a stream body, write part or all of the given
47-- file.
46-- file.
48−sendFilePart :: (Chunk -> IO ()) -> FilePath -> Maybe FilePart -> IO ()
47+writeFilePart :: (Chunk -> IO ()) -> FilePath -> Maybe FilePart -> IO ()
49−sendFilePart = (.: FileChunk)
48+writeFilePart = (.: FileChunk)
50 where f .: g = curry $ f . uncurry g
49 where f .: g = curry $ f . uncurry g
51
50
52-- | The streaming body of a response. Equivalent to
51-- | The streaming body of a response. Equivalent to