on master help sign in
Clean up QQ and Utils.Links haddock.
commitf4f86520bc1a65a8663f10aefcc7704b0dc6e5aa authorJulian K. Arni <jkarni@gmail.com> dateWed 10 Dec 2014, 10:34 (12 years ago) parent501dafa
2 files changed+18−2
src/Servant/QQ.hs+1−1 src/Servant/Utils/Links.hs+17−1
src/Servant/QQ.hs+1−1
@@ -26,7 +26,7 @@
2626-- @
2727--
2828-- Note the @/@ before a @QueryParam@!
29−module Servant.QQ where
29+module Servant.QQ (sitemap) where
3030
3131import Control.Monad (void)
3232import Control.Applicative hiding (many, (<|>), optional)
src/Servant/Utils/Links.hs+17−1
@@ -33,7 +33,20 @@
3333-- and part of the sitemap.
3434--
3535-- __N.B.:__ 'mkLink' assumes a capture matches any string (without slashes).
36−module Servant.Utils.Links where
36+module Servant.Utils.Links (
37+ -- * Link and mkLink
38+ -- | The only end-user utilities
39+ mkLink
40+ , Link
41+ -- * Internal
42+ -- | These functions will likely only be of interest if you are writing
43+ -- more API combinators and would like to extend the behavior of
44+ -- 'mkLink'
45+ , ValidLinkIn()
46+ , VLinkHelper(..)
47+ , IsElem
48+ , IsLink
49+ )where
3750
3851import Data.Proxy
3952import GHC.TypeLits
@@ -94,6 +107,9 @@ instance ( IsElem f s ~ 'True
94107 , VLinkHelper f) => ValidLinkIn f s where
95108 mkLink _ _ = Link (vlh (Proxy :: Proxy f))
96109
110+-- | A safe link datatype.
111+-- The only way of constructing a 'Link' is using 'mkLink', which means any
112+-- 'Link' is guaranteed to be part of the mentioned API.
97113data Link = Link String deriving Show
98114
99115class VLinkHelper f where