From f5d9983381b96ee1ce03e97e3e1d4982e1c92972 Mon Sep 17 00:00:00 2001 From: David Turner Date: Tue, 16 May 2017 15:59:41 +0000 Subject: [PATCH] Rename emptyAPIServer to emptyServer --- doc/tutorial/Docs.lhs | 2 +- doc/tutorial/Javascript.lhs | 2 +- doc/tutorial/Server.lhs | 2 +- servant-client/test/Servant/ClientSpec.hs | 3 +-- servant-server/src/Servant/Server.hs | 2 +- servant-server/src/Servant/Server/Internal.hs | 4 ++-- servant-server/test/Servant/ServerSpec.hs | 4 ++-- 7 files changed, 9 insertions(+), 10 deletions(-) diff --git a/doc/tutorial/Docs.lhs b/doc/tutorial/Docs.lhs index 9dae710c..9903ec98 100644 --- a/doc/tutorial/Docs.lhs +++ b/doc/tutorial/Docs.lhs @@ -221,7 +221,7 @@ api :: Proxy DocsAPI api = Proxy server :: Server DocsAPI -server = (Server.server3 :<|> emptyAPIServer) :<|> Tagged serveDocs where +server = (Server.server3 :<|> emptyServer) :<|> Tagged serveDocs where serveDocs _ respond = respond $ responseLBS ok200 [plain] docsBS plain = ("Content-Type", "text/plain") diff --git a/doc/tutorial/Javascript.lhs b/doc/tutorial/Javascript.lhs index 8187d2c2..f0158d1f 100644 --- a/doc/tutorial/Javascript.lhs +++ b/doc/tutorial/Javascript.lhs @@ -134,7 +134,7 @@ api' = Proxy server :: Server API server = randomPoint :<|> searchBook - :<|> emptyAPIServer + :<|> emptyServer server' :: Server API' server' = server diff --git a/doc/tutorial/Server.lhs b/doc/tutorial/Server.lhs index 75119cf6..a364224c 100644 --- a/doc/tutorial/Server.lhs +++ b/doc/tutorial/Server.lhs @@ -1026,7 +1026,7 @@ TODO prose type CombinedAPI2 = API :<|> EmptyAPI server11 :: Server CombinedAPI2 -server11 = server3 :<|> emptyAPIServer +server11 = server3 :<|> emptyServer ``` ## Using another monad for your handlers diff --git a/servant-client/test/Servant/ClientSpec.hs b/servant-client/test/Servant/ClientSpec.hs index 882c2a74..3a4a2481 100644 --- a/servant-client/test/Servant/ClientSpec.hs +++ b/servant-client/test/Servant/ClientSpec.hs @@ -166,8 +166,7 @@ server = serve api ( :<|> (\ a b c d -> return (a, b, c, d)) :<|> (return $ addHeader 1729 $ addHeader "eg2" True) :<|> return NoContent - :<|> emptyAPIServer - ) + :<|> emptyServer) type FailApi = diff --git a/servant-server/src/Servant/Server.hs b/servant-server/src/Servant/Server.hs index c3e1c90a..9a117821 100644 --- a/servant-server/src/Servant/Server.hs +++ b/servant-server/src/Servant/Server.hs @@ -18,7 +18,7 @@ module Servant.Server HasServer(..) , Server , EmptyServer - , emptyAPIServer + , emptyServer , Handler (..) , runHandler diff --git a/servant-server/src/Servant/Server/Internal.hs b/servant-server/src/Servant/Server/Internal.hs index f343f038..8880d35c 100644 --- a/servant-server/src/Servant/Server/Internal.hs +++ b/servant-server/src/Servant/Server/Internal.hs @@ -536,8 +536,8 @@ instance HasServer api context => HasServer (HttpVersion :> api) context where data EmptyServer = EmptyServer deriving (Typeable, Eq, Show, Bounded, Enum) -- | Server for `EmptyAPI` -emptyAPIServer :: Server EmptyAPI -emptyAPIServer = Tagged EmptyServer +emptyServer :: Server EmptyAPI +emptyServer = Tagged EmptyServer -- | The server for an `EmptyAPI` is `emptyAPIServer`. -- diff --git a/servant-server/test/Servant/ServerSpec.hs b/servant-server/test/Servant/ServerSpec.hs index fbcd1929..0a641559 100644 --- a/servant-server/test/Servant/ServerSpec.hs +++ b/servant-server/test/Servant/ServerSpec.hs @@ -49,7 +49,7 @@ import Servant.API ((:<|>) (..), (:>), AuthProtect, import Servant.API.Internal.Test.ComprehensiveAPI import Servant.Server (Server, Handler, Tagged (..), err401, err403, err404, serve, serveWithContext, - Context((:.), EmptyContext), emptyAPIServer) + Context((:.), EmptyContext), emptyServer) import Test.Hspec (Spec, context, describe, it, shouldBe, shouldContain) import qualified Test.Hspec.Wai as THW @@ -618,7 +618,7 @@ miscServ :: Server MiscCombinatorsAPI miscServ = versionHandler :<|> secureHandler :<|> hostHandler - :<|> emptyAPIServer + :<|> emptyServer where versionHandler = return . show secureHandler Secure = return "secure"