@@ -8,7 +8,6 @@
8module Servant.Server where
8module Servant.Server where
10import Data.Proxy
10import Data.Proxy
12import Network.HTTP.Types
11import Network.HTTP.Types
13import Network.Wai
12import Network.Wai
@@ -20,7 +19,7 @@ serve p server = toApplication (route p server)
21toApplication :: RoutingApplication -> Application
20toApplication :: RoutingApplication -> Application
22toApplication ra request respond = do
21toApplication ra request respond = do
23− ra (pathInfo request) request routingRespond
22+ ra request routingRespond
25 routingRespond :: Maybe Response -> IO ResponseReceived
24 routingRespond :: Maybe Response -> IO ResponseReceived
26 routingRespond Nothing =
25 routingRespond Nothing =
@@ -29,8 +28,7 @@ toApplication ra request respond = do
29 respond response
28 respond response
31type RoutingApplication =
30type RoutingApplication =
32− [Text] -- ^ the unmodified 'pathInfo'
33− -> Request -- ^ the request, the field 'pathInfo' may be modified by url routing
31+ Request -- ^ the request, the field 'pathInfo' may be modified by url routing
34 -> (Maybe Response -> IO ResponseReceived) -> IO ResponseReceived
32 -> (Maybe Response -> IO ResponseReceived) -> IO ResponseReceived
36class HasServer layout where
34class HasServer layout where