Remove hardcoded param in serveWithContext

This commit is contained in:
Sasa Bogicevic 2018-04-27 11:03:37 +02:00
parent a90b671607
commit 4d46e98419

View file

@ -126,11 +126,12 @@ import Servant.Server.Internal
serve :: (HasServer api '[Bool]) => Proxy api -> Server api -> Application serve :: (HasServer api '[Bool]) => Proxy api -> Server api -> Application
serve p = serveWithContext p (False :. EmptyContext) serve p = serveWithContext p (False :. EmptyContext)
serveWithContext :: (HasServer api context) serveWithContext :: (HasServer api context, HasContextEntry context Bool)
=> Proxy api -> Context context -> Server api -> Application => Proxy api -> Context context -> Server api -> Application
serveWithContext p context server = serveWithContext p context server =
toApplication toApplication
False -- determins if we should fully evaluate response (getContextEntry context :: Bool)
-- ^ determins if we should fully evaluate response
(runRouter (route p context (emptyDelayed (Route server)))) (runRouter (route p context (emptyDelayed (Route server))))
-- | Hoist server implementation. -- | Hoist server implementation.