From 465e0b8f10edb174e9741d9f07f511f925c06970 Mon Sep 17 00:00:00 2001 From: Sasa Bogicevic Date: Fri, 6 Jul 2018 17:10:15 +0200 Subject: [PATCH] Make everyting compile again --- servant-server/example/greet.hs | 1 - servant-server/src/Servant/Server.hs | 21 ++++----------------- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/servant-server/example/greet.hs b/servant-server/example/greet.hs index 662c2c33..d4121ab4 100644 --- a/servant-server/example/greet.hs +++ b/servant-server/example/greet.hs @@ -6,7 +6,6 @@ {-# LANGUAGE TypeOperators #-} import Data.Aeson -import Data.Monoid import Data.Proxy import Data.Text import GHC.Generics diff --git a/servant-server/src/Servant/Server.hs b/servant-server/src/Servant/Server.hs index 85c0568d..10bb4d97 100644 --- a/servant-server/src/Servant/Server.hs +++ b/servant-server/src/Servant/Server.hs @@ -10,8 +10,6 @@ module Servant.Server ( -- * Run a wai application from an API serve , serveWithContext - , fullyEvalResponse - , noEvalResponse , -- * Construct a wai Application from an API toApplication @@ -128,24 +126,13 @@ import Servant.Server.Internal -- > main :: IO () -- > main = Network.Wai.Handler.Warp.run 8080 app -- +serve :: (HasServer api '[]) => Proxy api -> Server api -> Application +serve p = serveWithContext p EmptyContext -serve :: (HasServer api '[Bool]) => Proxy api -> Server api -> Application -serve p = serveWithContext p noEvalResponse - -serveWithContext :: (HasServer api context, HasContextEntry context Bool) +serveWithContext :: (HasServer api context) => Proxy api -> Context context -> Server api -> Application serveWithContext p context server = - toApplication - ((getContextEntry context :: Bool) || False) - -- ^ determins if we should fully evaluate response - -- defaults to False - (runRouter (route p context (emptyDelayed (Route server)))) - -fullyEvalResponse :: Context '[Bool] -fullyEvalResponse = True :. EmptyContext - -noEvalResponse :: Context '[Bool] -noEvalResponse = False :. EmptyContext + toApplication True (runRouter (route p context (emptyDelayed (Route server)))) -- | Hoist server implementation. --