@@ -1,13 +1,20 @@
1{-# LANGUAGE OverloadedStrings, RankNTypes #-}
1{-# LANGUAGE OverloadedStrings, RankNTypes #-}
2{-# LANGUAGE CPP #-}
2{-# LANGUAGE CPP #-}
3module Network.Wai.HTTP2
3module Network.Wai.HTTP2
5− , HTTP2Application
6+ HTTP2Application
8 , Responder
7 , Responder
9 , Trailers
12 , Trailers
10 , promiseHeaders
15 , promiseHeaders
11 , promoteApplication
18 , promoteApplication
12 , responder
19 , responder
13 , streamFilePart
20 , streamFilePart
@@ -58,15 +65,16 @@ type Body a = BodyOf Chunk a
58-- 'Network.Wai.StreamingBody' with @c ~ Builder@ and @a ~ ()@.
65-- 'Network.Wai.StreamingBody' with @c ~ Builder@ and @a ~ ()@.
59type BodyOf c a = (c -> IO ()) -> IO () -> IO a
66type BodyOf c a = (c -> IO ()) -> IO () -> IO a
61−-- | A function given to an 'HTTP2Application' used to send the response. This
68+-- | The result of an 'HTTP2Application'; or, alternately, an application
69+-- that's independent of the request. This is a continuation-passing style
70+-- function that first provides a response by calling the given respond
71+-- function, then returns the request's 'Trailers'.
62−-- is similar to the respond function in 'Network.Wai.Application', but the
73+-- The respond function is similar to the one in 'Network.Wai.Application', but
74+-- it only takes a streaming body, the status and headers are curried, and it
63−-- status and headers are curried, and it passes on any result value from the
75+-- passes on any result value from the stream body.
65−type RespondFunc = forall a. H.Status -> H.ResponseHeaders -> Body a -> IO a
76+type Responder = (forall a. H.Status -> H.ResponseHeaders -> Body a -> IO a)
67−-- | A continuation-passing style function that provides a response by calling
68−-- the 'RespondFunc', then returns the request's 'Trailers'.
69−type Responder = RespondFunc -> IO Trailers
77+ -> IO Trailers
71-- | A function given to an 'HTTP2Application' to initiate a server-pushed
79-- | A function given to an 'HTTP2Application' to initiate a server-pushed
72-- stream. Its argument is the same as the result of an 'HTTP2Application', so
80-- stream. Its argument is the same as the result of an 'HTTP2Application', so