on master help sign in
Merge pull request #1 from haskell-servant/jkarni/cleaner-haddock
741da9fAlp Mestanogullari
src/Servant/QQ.hs+1−1
@@ -26,7 +26,7 @@
26-- @
26-- @
27--
27--
28-- Note the @/@ before a @QueryParam@!
28-- Note the @/@ before a @QueryParam@!
29−module Servant.QQ where
29+module Servant.QQ (sitemap) where
30
30
31import Control.Monad (void)
31import Control.Monad (void)
32import Control.Applicative hiding (many, (<|>), optional)
32import Control.Applicative hiding (many, (<|>), optional)
src/Servant/Utils/Links.hs+17−1
@@ -33,7 +33,20 @@
33-- and part of the sitemap.
33-- and part of the sitemap.
34--
34--
35-- __N.B.:__ 'mkLink' assumes a capture matches any string (without slashes).
35-- __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
37
50
38import Data.Proxy
51import Data.Proxy
39import GHC.TypeLits
52import GHC.TypeLits
@@ -94,6 +107,9 @@ instance ( IsElem f s ~ 'True
94 , VLinkHelper f) => ValidLinkIn f s where
107 , VLinkHelper f) => ValidLinkIn f s where
95 mkLink _ _ = Link (vlh (Proxy :: Proxy f))
108 mkLink _ _ = Link (vlh (Proxy :: Proxy f))
96
109
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.
97data Link = Link String deriving Show
113data Link = Link String deriving Show
98
114
99class VLinkHelper f where
115class VLinkHelper f where