@@ -1,8 +1,9 @@
1−{-# LANGUAGE RankNTypes #-}
1+{-# LANGUAGE EmptyCase, EmptyDataDecls, RankNTypes #-}
2module Network.Wai.HTTP2
2module Network.Wai.HTTP2
3 ( Http2Application
3 ( Http2Application
6 , responseStatus
7 , responseStatus
7 , responseStream
8 , responseStream
8 , responseHeaders
9 , responseHeaders
@@ -17,9 +18,19 @@ import qualified Network.Wai.Internal as H1 (Request)
17-- the HTTP\/1.1 spec (RFC 7230), and section 8.1 of the HTTP\/2 spec.
18-- the HTTP\/1.1 spec (RFC 7230), and section 8.1 of the HTTP\/2 spec.
18type Trailers = H.ResponseHeaders
19type Trailers = H.ResponseHeaders
20−-- | The type of an HTTP\/2 request.
21+-- | The synthesized request and headers of a pushed stream.
21−-- TODO(awpr): specialize this for HTTP\/2.
22+-- TODO(awpr): implement for real.
25+-- 'PushPromise' is currently uninhabited, which proves the caller cannot use
26+-- 'pushPromise'. This discharges the obligation to implement any function
27+-- taking a 'PushPromise'.
28+absurd :: PushPromise -> a
29+absurd p = case p of {}
31+-- | The type of an HTTP\/2 request: a normal HTTP request and an action to
32+-- push streams associated with this request.
22−type Request = H1.Request
33+type Request = (H1.Request, PushPromise -> Responder -> IO ())
24-- | The HTTP\/2-aware equivalent of 'Network.Wai.Application'.
35-- | The HTTP\/2-aware equivalent of 'Network.Wai.Application'.
25type Http2Application = Request -> Responder
36type Http2Application = Request -> Responder