Add docs for serving an EmptyAPI

This commit is contained in:
David Turner 2017-05-16 11:09:54 +00:00
parent 178f05595a
commit 62560079b1

View file

@ -532,11 +532,19 @@ instance HasServer api context => HasServer (HttpVersion :> api) context where
route Proxy context subserver = route Proxy context subserver =
route (Proxy :: Proxy api) context (passToServer subserver httpVersion) route (Proxy :: Proxy api) context (passToServer subserver httpVersion)
-- | Singleton type representing a server that serves an empty API
data EmptyAPIServer = EmptyAPIServer data EmptyAPIServer = EmptyAPIServer
-- | Server for `EmptyAPI`
emptyAPIServer :: Server EmptyAPI emptyAPIServer :: Server EmptyAPI
emptyAPIServer = Tagged EmptyAPIServer emptyAPIServer = Tagged EmptyAPIServer
-- | The server for an `EmptyAPI` is `emptyAPIServer`.
--
-- > type MyApi = "nothing" :> EmptyApi
-- >
-- > server :: Server MyApi
-- > server = emptyAPIServer
instance HasServer EmptyAPI context where instance HasServer EmptyAPI context where
type ServerT EmptyAPI m = Tagged m EmptyAPIServer type ServerT EmptyAPI m = Tagged m EmptyAPIServer