Add docs for serving an EmptyAPI
This commit is contained in:
parent
178f05595a
commit
62560079b1
1 changed files with 8 additions and 0 deletions
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue