git.iko.soy/typeable/servant
on master help sign in
Documentation for config.
commitb8f453127b1dcebc74c9bd998d2b06398e1ad279 authorJulian K. Arni <jkarni@gmail.com> dateMon 18 Jan 2016, 22:26 (11 years ago) parent2445855
1 file changed+17
servant/src/Servant/API/WithNamedConfig.hs+17
servant/src/Servant/API/WithNamedConfig.hs+17
@@ -5,4 +5,21 @@ module Servant.API.WithNamedConfig where
55
66import GHC.TypeLits
77
8+-- | 'WithNamedConfig' names a specific tagged configuration to use for the
9+-- combinators in the API. For example:
10+--
11+-- > type UseNamedConfigAPI1 = WithNamedConfig "myConfig" '[String] (
12+-- > ReqBody '[JSON] Int :> Get '[JSON] Int)
13+--
14+-- Both the 'ReqBody' and 'Get' combinators will use the 'NamedConfig' with
15+-- type tag "myConfig" as their configuration. In constrast, in (notice
16+-- parentesizing):
17+--
18+-- > type UseNamedConfigAPI2 = WithNamedConfig "myConfig" '[String] (
19+-- > ReqBody '[JSON] Int) :> Get '[JSON] Int
20+--
21+-- Only the 'ReqBody' combinator will use this configuration, and 'Get' will
22+-- maintain the default configuration.
23+--
24+-- For more information, see the tutorial.
825data WithNamedConfig (name :: Symbol) (subConfig :: [*]) subApi