@@ -86,7 +86,7 @@ class HasServer api context where
8686 -> Delayed env (Server api)
8787 -> Router env
8888
89− hoistServer
89+ hoistServerWithContext
9090 :: Proxy api
9191 -> Proxy context
9292 -> (forall x. m x -> n x)
@@ -118,9 +118,9 @@ instance (HasServer a context, HasServer b context) => HasServer (a :<|> b) cont
118118 pb = Proxy :: Proxy b
119119
120120 -- | This is better than 'enter', as it's tailor made for 'HasServer'.
121− hoistServer _ pc nt (a :<|> b) =
122− hoistServer (Proxy :: Proxy a) pc nt a :<|>
123− hoistServer (Proxy :: Proxy b) pc nt b
121+ hoistServerWithContext _ pc nt (a :<|> b) =
122+ hoistServerWithContext (Proxy :: Proxy a) pc nt a :<|>
123+ hoistServerWithContext (Proxy :: Proxy b) pc nt b
124124
125125-- | If you use 'Capture' in one of the endpoints for your API,
126126-- this automatically requires your server-side handler to be a function
@@ -145,7 +145,7 @@ instance (KnownSymbol capture, FromHttpApiData a, HasServer api context)
145145 type ServerT (Capture capture a :> api) m =
146146 a -> ServerT api m
147147
148− hoistServer _ pc nt s = hoistServer (Proxy :: Proxy api) pc nt . s
148+ hoistServerWithContext _ pc nt s = hoistServerWithContext (Proxy :: Proxy api) pc nt . s
149149
150150 route Proxy context d =
151151 CaptureRouter $
@@ -179,7 +179,7 @@ instance (KnownSymbol capture, FromHttpApiData a, HasServer api context)
179179 type ServerT (CaptureAll capture a :> api) m =
180180 [a] -> ServerT api m
181181
182− hoistServer _ pc nt s = hoistServer (Proxy :: Proxy api) pc nt . s
182+ hoistServerWithContext _ pc nt s = hoistServerWithContext (Proxy :: Proxy api) pc nt . s
183183
184184 route Proxy context d =
185185 CaptureAllRouter $
@@ -258,7 +258,7 @@ instance OVERLAPPABLE_
258258 ) => HasServer (Verb method status ctypes a) context where
259259
260260 type ServerT (Verb method status ctypes a) m = m a
261− hoistServer _ _ nt s = nt s
261+ hoistServerWithContext _ _ nt s = nt s
262262
263263 route Proxy _ = methodRouter method (Proxy :: Proxy ctypes) status
264264 where method = reflectMethod (Proxy :: Proxy method)
@@ -270,7 +270,7 @@ instance OVERLAPPING_
270270 ) => HasServer (Verb method status ctypes (Headers h a)) context where
271271
272272 type ServerT (Verb method status ctypes (Headers h a)) m = m (Headers h a)
273− hoistServer _ _ nt s = nt s
273+ hoistServerWithContext _ _ nt s = nt s
274274
275275 route Proxy _ = methodRouterHeaders method (Proxy :: Proxy ctypes) status
276276 where method = reflectMethod (Proxy :: Proxy method)
@@ -302,7 +302,7 @@ instance (KnownSymbol sym, FromHttpApiData a, HasServer api context)
302302 type ServerT (Header sym a :> api) m =
303303 Maybe a -> ServerT api m
304304
305− hoistServer _ pc nt s = hoistServer (Proxy :: Proxy api) pc nt . s
305+ hoistServerWithContext _ pc nt s = hoistServerWithContext (Proxy :: Proxy api) pc nt . s
306306
307307 route Proxy context subserver = route (Proxy :: Proxy api) context $
308308 subserver `addHeaderCheck` withRequest headerCheck
@@ -347,7 +347,7 @@ instance (KnownSymbol sym, FromHttpApiData a, HasServer api context)
347347 type ServerT (QueryParam sym a :> api) m =
348348 Maybe a -> ServerT api m
349349
350− hoistServer _ pc nt s = hoistServer (Proxy :: Proxy api) pc nt . s
350+ hoistServerWithContext _ pc nt s = hoistServerWithContext (Proxy :: Proxy api) pc nt . s
351351
352352 route Proxy context subserver =
353353 let querytext req = parseQueryText $ rawQueryString req
@@ -394,7 +394,7 @@ instance (KnownSymbol sym, FromHttpApiData a, HasServer api context)
394394 type ServerT (QueryParams sym a :> api) m =
395395 [a] -> ServerT api m
396396
397− hoistServer _ pc nt s = hoistServer (Proxy :: Proxy api) pc nt . s
397+ hoistServerWithContext _ pc nt s = hoistServerWithContext (Proxy :: Proxy api) pc nt . s
398398
399399 route Proxy context subserver = route (Proxy :: Proxy api) context $
400400 subserver `addParameterCheck` withRequest paramsCheck
@@ -436,7 +436,7 @@ instance (KnownSymbol sym, HasServer api context)
436436 type ServerT (QueryFlag sym :> api) m =
437437 Bool -> ServerT api m
438438
439− hoistServer _ pc nt s = hoistServer (Proxy :: Proxy api) pc nt . s
439+ hoistServerWithContext _ pc nt s = hoistServerWithContext (Proxy :: Proxy api) pc nt . s
440440
441441 route Proxy context subserver =
442442 let querytext r = parseQueryText $ rawQueryString r
@@ -461,7 +461,7 @@ instance HasServer Raw context where
461461
462462 type ServerT Raw m = Tagged m Application
463463
464− hoistServer _ _ _ = retag
464+ hoistServerWithContext _ _ _ = retag
465465
466466 route Proxy _ rawApplication = RawRouter $ \ env request respond -> runResourceT $ do
467467 -- note: a Raw application doesn't register any cleanup
@@ -502,7 +502,7 @@ instance ( AllCTUnrender list a, HasServer api context
502502 type ServerT (ReqBody list a :> api) m =
503503 a -> ServerT api m
504504
505− hoistServer _ pc nt s = hoistServer (Proxy :: Proxy api) pc nt . s
505+ hoistServerWithContext _ pc nt s = hoistServerWithContext (Proxy :: Proxy api) pc nt . s
506506
507507 route Proxy context subserver
508508 = route (Proxy :: Proxy api) context $
@@ -538,14 +538,14 @@ instance (KnownSymbol path, HasServer api context) => HasServer (path :> api) co
538538 (cs (symbolVal proxyPath))
539539 (route (Proxy :: Proxy api) context subserver)
540540 where proxyPath = Proxy :: Proxy path
541− hoistServer _ pc nt s = hoistServer (Proxy :: Proxy api) pc nt s
541+ hoistServerWithContext _ pc nt s = hoistServerWithContext (Proxy :: Proxy api) pc nt s
542542
543543instance HasServer api context => HasServer (RemoteHost :> api) context where
544544 type ServerT (RemoteHost :> api) m = SockAddr -> ServerT api m
545545
546546 route Proxy context subserver =
547547 route (Proxy :: Proxy api) context (passToServer subserver remoteHost)
548− hoistServer _ pc nt s = hoistServer (Proxy :: Proxy api) pc nt . s
548+ hoistServerWithContext _ pc nt s = hoistServerWithContext (Proxy :: Proxy api) pc nt . s
549549
550550instance HasServer api context => HasServer (IsSecure :> api) context where
551551 type ServerT (IsSecure :> api) m = IsSecure -> ServerT api m
@@ -554,35 +554,35 @@ instance HasServer api context => HasServer (IsSecure :> api) context where
554554 route (Proxy :: Proxy api) context (passToServer subserver secure)
555555 where secure req = if isSecure req then Secure else NotSecure
556556
557− hoistServer _ pc nt s = hoistServer (Proxy :: Proxy api) pc nt . s
557+ hoistServerWithContext _ pc nt s = hoistServerWithContext (Proxy :: Proxy api) pc nt . s
558558
559559instance HasServer api context => HasServer (Vault :> api) context where
560560 type ServerT (Vault :> api) m = Vault -> ServerT api m
561561
562562 route Proxy context subserver =
563563 route (Proxy :: Proxy api) context (passToServer subserver vault)
564− hoistServer _ pc nt s = hoistServer (Proxy :: Proxy api) pc nt . s
564+ hoistServerWithContext _ pc nt s = hoistServerWithContext (Proxy :: Proxy api) pc nt . s
565565
566566instance HasServer api context => HasServer (HttpVersion :> api) context where
567567 type ServerT (HttpVersion :> api) m = HttpVersion -> ServerT api m
568568
569569 route Proxy context subserver =
570570 route (Proxy :: Proxy api) context (passToServer subserver httpVersion)
571− hoistServer _ pc nt s = hoistServer (Proxy :: Proxy api) pc nt . s
571+ hoistServerWithContext _ pc nt s = hoistServerWithContext (Proxy :: Proxy api) pc nt . s
572572
573573-- | Ignore @'Summary'@ in server handlers.
574574instance HasServer api ctx => HasServer (Summary desc :> api) ctx where
575575 type ServerT (Summary desc :> api) m = ServerT api m
576576
577577 route _ = route (Proxy :: Proxy api)
578− hoistServer _ pc nt s = hoistServer (Proxy :: Proxy api) pc nt s
578+ hoistServerWithContext _ pc nt s = hoistServerWithContext (Proxy :: Proxy api) pc nt s
579579
580580-- | Ignore @'Description'@ in server handlers.
581581instance HasServer api ctx => HasServer (Description desc :> api) ctx where
582582 type ServerT (Description desc :> api) m = ServerT api m
583583
584584 route _ = route (Proxy :: Proxy api)
585− hoistServer _ pc nt s = hoistServer (Proxy :: Proxy api) pc nt s
585+ hoistServerWithContext _ pc nt s = hoistServerWithContext (Proxy :: Proxy api) pc nt s
586586
587587-- | Singleton type representing a server that serves an empty API.
588588data EmptyServer = EmptyServer deriving (Typeable, Eq, Show, Bounded, Enum)
@@ -602,7 +602,7 @@ instance HasServer EmptyAPI context where
602602
603603 route Proxy _ _ = StaticRouter mempty mempty
604604
605− hoistServer _ _ _ = retag
605+ hoistServerWithContext _ _ _ = retag
606606
607607-- | Basic Authentication
608608instance ( KnownSymbol realm
@@ -620,7 +620,7 @@ instance ( KnownSymbol realm
620620 basicAuthContext = getContextEntry context
621621 authCheck = withRequest $ \ req -> runBasicAuth req realm basicAuthContext
622622
623− hoistServer _ pc nt s = hoistServer (Proxy :: Proxy api) pc nt . s
623+ hoistServerWithContext _ pc nt s = hoistServerWithContext (Proxy :: Proxy api) pc nt . s
624624
625625-- * helpers
626626
@@ -647,4 +647,4 @@ instance (HasContextEntry context (NamedContext name subContext), HasServer subA
647647 subContext :: Context subContext
648648 subContext = descendIntoNamedContext (Proxy :: Proxy name) context
649649
650− hoistServer _ _ nt s = hoistServer (Proxy :: Proxy subApi) (Proxy :: Proxy subContext) nt s
650+ hoistServerWithContext _ _ nt s = hoistServerWithContext (Proxy :: Proxy subApi) (Proxy :: Proxy subContext) nt s