git.iko.soy/typeable/servant
on master help sign in
docs(generic): Improve the documentation for `genericServerT`

This commit adds an explanation and a link to the Servant Cookbook to `genericServerT`. Moreover, the `genericServer` and `genericServe`'s haddocks are slightly edited to add a missing 'a'.

commitb3b3dc9f4136f7400d2de61949c367d49e09d75c authorThéophile Choutri <theophile.choutri@fretlink.com> dateWed 4 Mar 2020, 15:53 (7 years ago) parent5998429
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)