Switched order of type parameters
This commit is contained in:
parent
775b239f7f
commit
e92bac0803
1 changed files with 11 additions and 10 deletions
|
@ -39,14 +39,15 @@ import Servant.Server
|
|||
import Servant.Server.Internal
|
||||
|
||||
data ServerCombinator combinator serverType api context where
|
||||
data ServerCombinator combinator api context serverType where
|
||||
CI :: (forall env .
|
||||
Proxy (combinator :> api)
|
||||
-> Context context
|
||||
-> Delayed env serverType
|
||||
-> Router' env RoutingApplication)
|
||||
-> ServerCombinator combinator serverType api context
|
||||
-> ServerCombinator combinator api context serverType
|
||||
|
||||
runServerCombinator :: ServerCombinator combinator serverType api context
|
||||
runServerCombinator :: ServerCombinator combinator api context serverType
|
||||
-> Proxy (combinator :> api)
|
||||
-> Context context
|
||||
-> Delayed env serverType
|
||||
|
@ -69,14 +70,14 @@ runServerCombinator (CI i) = i
|
|||
makeCaptureCombinator ::
|
||||
(HasServer api context) =>
|
||||
(Context context -> Text -> IO (RouteResult arg))
|
||||
-> ServerCombinator combinator (arg -> ServerT api Handler) api context
|
||||
-> ServerCombinator combinator api context (arg -> ServerT api Handler)
|
||||
makeCaptureCombinator = inner -- we use 'inner' to avoid having 'forall' show up in haddock docs
|
||||
where
|
||||
inner ::
|
||||
forall api combinator arg context .
|
||||
(HasServer api context) =>
|
||||
(Context context -> Text -> IO (RouteResult arg))
|
||||
-> ServerCombinator combinator (arg -> ServerT api Handler) api context
|
||||
-> ServerCombinator combinator api context (arg -> ServerT api Handler)
|
||||
inner getArg = CI $ \ Proxy context delayed ->
|
||||
CaptureRouter $
|
||||
route (Proxy :: Proxy api) context $ addCapture delayed $ \ captured ->
|
||||
|
@ -96,14 +97,14 @@ makeCaptureCombinator = inner -- we use 'inner' to avoid having 'forall' show up
|
|||
makeRequestCheckCombinator ::
|
||||
(HasServer api context) =>
|
||||
(Context context -> Request -> IO (RouteResult ()))
|
||||
-> ServerCombinator combinator (ServerT api Handler) api context
|
||||
-> ServerCombinator combinator api context (ServerT api Handler)
|
||||
makeRequestCheckCombinator = inner
|
||||
where
|
||||
inner ::
|
||||
forall api combinator context .
|
||||
(HasServer api context) =>
|
||||
(Context context -> Request -> IO (RouteResult ()))
|
||||
-> ServerCombinator combinator (ServerT api Handler) api context
|
||||
-> ServerCombinator combinator api context (ServerT api Handler)
|
||||
inner check = CI $ \ Proxy context delayed ->
|
||||
route (Proxy :: Proxy api) context $ addMethodCheck delayed $
|
||||
withRequest $ \ request ->
|
||||
|
@ -112,14 +113,14 @@ makeRequestCheckCombinator = inner
|
|||
makeAuthCombinator ::
|
||||
(HasServer api context) =>
|
||||
(Context context -> Request -> IO (RouteResult arg))
|
||||
-> ServerCombinator combinator (arg -> ServerT api Handler) api context
|
||||
-> ServerCombinator combinator api context (arg -> ServerT api Handler)
|
||||
makeAuthCombinator = inner
|
||||
where
|
||||
inner ::
|
||||
forall api combinator arg context .
|
||||
(HasServer api context) =>
|
||||
(Context context -> Request -> IO (RouteResult arg))
|
||||
-> ServerCombinator combinator (arg -> ServerT api Handler) api context
|
||||
-> ServerCombinator combinator api context (arg -> ServerT api Handler)
|
||||
inner authCheck = CI $ \ Proxy context delayed ->
|
||||
route (Proxy :: Proxy api) context $ addAuthCheck delayed $
|
||||
withRequest $ \ request ->
|
||||
|
@ -128,14 +129,14 @@ makeAuthCombinator = inner
|
|||
makeCombinator ::
|
||||
(HasServer api context) =>
|
||||
(Context context -> Request -> IO (RouteResult arg))
|
||||
-> ServerCombinator combinator (arg -> ServerT api Handler) api context
|
||||
-> ServerCombinator combinator api context (arg -> ServerT api Handler)
|
||||
makeCombinator = inner
|
||||
where
|
||||
inner ::
|
||||
forall api combinator arg context .
|
||||
(HasServer api context) =>
|
||||
(Context context -> Request -> IO (RouteResult arg))
|
||||
-> ServerCombinator combinator (arg -> ServerT api Handler) api context
|
||||
-> ServerCombinator combinator api context (arg -> ServerT api Handler)
|
||||
inner getArg = CI $ \ Proxy context delayed ->
|
||||
route (Proxy :: Proxy api) context $ addBodyCheck delayed
|
||||
(return ())
|
||||
|
|
Loading…
Reference in a new issue