From b8f453127b1dcebc74c9bd998d2b06398e1ad279 Mon Sep 17 00:00:00 2001 From: "Julian K. Arni" Date: Mon, 18 Jan 2016 22:26:23 +0100 Subject: [PATCH] Documentation for config. --- servant/src/Servant/API/WithNamedConfig.hs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/servant/src/Servant/API/WithNamedConfig.hs b/servant/src/Servant/API/WithNamedConfig.hs index 3f234292..1beb3b8d 100644 --- a/servant/src/Servant/API/WithNamedConfig.hs +++ b/servant/src/Servant/API/WithNamedConfig.hs @@ -5,4 +5,21 @@ module Servant.API.WithNamedConfig where import GHC.TypeLits +-- | 'WithNamedConfig' names a specific tagged configuration to use for the +-- combinators in the API. For example: +-- +-- > type UseNamedConfigAPI1 = WithNamedConfig "myConfig" '[String] ( +-- > ReqBody '[JSON] Int :> Get '[JSON] Int) +-- +-- Both the 'ReqBody' and 'Get' combinators will use the 'NamedConfig' with +-- type tag "myConfig" as their configuration. In constrast, in (notice +-- parentesizing): +-- +-- > type UseNamedConfigAPI2 = WithNamedConfig "myConfig" '[String] ( +-- > ReqBody '[JSON] Int) :> Get '[JSON] Int +-- +-- Only the 'ReqBody' combinator will use this configuration, and 'Get' will +-- maintain the default configuration. +-- +-- For more information, see the tutorial. data WithNamedConfig (name :: Symbol) (subConfig :: [*]) subApi