on master help sign in
Merge pull request #1279 from theophile-fl/docs/improve-genericServerT

docs(generic): Improve the documentation for `genericServerT`

commit567eb733d212c2539a1e25ffe71a3cf9dd7b9926 authorOleg Grenrus <oleg.grenrus@iki.fi> dateWed 4 Mar 2020, 18:23 (7 years ago) parent5998429b3b3dc9
1 file changed+6−2
servant-server/src/Servant/Server/Generic.hs+6−2
servant-server/src/Servant/Server/Generic.hs+6−2
@@ -31,7 +31,7 @@ instance GenericMode (AsServerT m) where
3131
3232type AsServer = AsServerT Handler
3333
34−-- | Transform record of routes into a WAI 'Application'.
34+-- | Transform a record of routes into a WAI 'Application'.
3535genericServe
3636 :: forall routes.
3737 ( HasServer (ToServantApi routes) '[]
@@ -80,13 +80,17 @@ genericServeTWithContext f server ctx =
8080 p = genericApi (Proxy :: Proxy routes)
8181 pctx = Proxy :: Proxy ctx
8282
83−-- | Transform record of endpoints into a 'Server'.
83+-- | Transform a record of endpoints into a 'Server'.
8484genericServer
8585 :: GenericServant routes AsServer
8686 => routes AsServer
8787 -> ToServant routes AsServer
8888genericServer = toServant
8989
90+-- | Transform a record of endpoints into a @'ServerT' m@.
91+--
92+-- You can see an example usage of this function
93+-- <https://docs.servant.dev/en/stable/cookbook/generic/Generic.html#using-generics-together-with-a-custom-monad in the Servant Cookbook>.
9094genericServerT
9195 :: GenericServant routes (AsServerT m)
9296 => routes (AsServerT m)