From 62560079b1bd275c53c3b1a79c433da9b4c8c33d Mon Sep 17 00:00:00 2001 From: David Turner Date: Tue, 16 May 2017 11:09:54 +0000 Subject: [PATCH] Add docs for serving an EmptyAPI --- servant-server/src/Servant/Server/Internal.hs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/servant-server/src/Servant/Server/Internal.hs b/servant-server/src/Servant/Server/Internal.hs index fc2c80c0..057e3f19 100644 --- a/servant-server/src/Servant/Server/Internal.hs +++ b/servant-server/src/Servant/Server/Internal.hs @@ -532,11 +532,19 @@ instance HasServer api context => HasServer (HttpVersion :> api) context where route Proxy context subserver = route (Proxy :: Proxy api) context (passToServer subserver httpVersion) +-- | Singleton type representing a server that serves an empty API data EmptyAPIServer = EmptyAPIServer +-- | Server for `EmptyAPI` emptyAPIServer :: Server EmptyAPI emptyAPIServer = Tagged EmptyAPIServer +-- | The server for an `EmptyAPI` is `emptyAPIServer`. +-- +-- > type MyApi = "nothing" :> EmptyApi +-- > +-- > server :: Server MyApi +-- > server = emptyAPIServer instance HasServer EmptyAPI context where type ServerT EmptyAPI m = Tagged m EmptyAPIServer