Merge pull request #1279 from theophile-fl/docs/improve-genericServerT

docs(generic): Improve the documentation for `genericServerT`
This commit is contained in:
Oleg Grenrus 2020-03-04 18:23:38 +02:00 committed by GitHub
commit 567eb733d2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -31,7 +31,7 @@ instance GenericMode (AsServerT m) where
type AsServer = AsServerT Handler type AsServer = AsServerT Handler
-- | Transform record of routes into a WAI 'Application'. -- | Transform a record of routes into a WAI 'Application'.
genericServe genericServe
:: forall routes. :: forall routes.
( HasServer (ToServantApi routes) '[] ( HasServer (ToServantApi routes) '[]
@ -80,13 +80,17 @@ genericServeTWithContext f server ctx =
p = genericApi (Proxy :: Proxy routes) p = genericApi (Proxy :: Proxy routes)
pctx = Proxy :: Proxy ctx pctx = Proxy :: Proxy ctx
-- | Transform record of endpoints into a 'Server'. -- | Transform a record of endpoints into a 'Server'.
genericServer genericServer
:: GenericServant routes AsServer :: GenericServant routes AsServer
=> routes AsServer => routes AsServer
-> ToServant routes AsServer -> ToServant routes AsServer
genericServer = toServant genericServer = toServant
-- | Transform a record of endpoints into a @'ServerT' m@.
--
-- You can see an example usage of this function
-- <https://docs.servant.dev/en/stable/cookbook/generic/Generic.html#using-generics-together-with-a-custom-monad in the Servant Cookbook>.
genericServerT genericServerT
:: GenericServant routes (AsServerT m) :: GenericServant routes (AsServerT m)
=> routes (AsServerT m) => routes (AsServerT m)