Clean up QQ and Utils.Links haddock.
This commit is contained in:
parent
501dafaeba
commit
f4f86520bc
2 changed files with 18 additions and 2 deletions
|
@ -26,7 +26,7 @@
|
||||||
-- @
|
-- @
|
||||||
--
|
--
|
||||||
-- Note the @/@ before a @QueryParam@!
|
-- Note the @/@ before a @QueryParam@!
|
||||||
module Servant.QQ where
|
module Servant.QQ (sitemap) where
|
||||||
|
|
||||||
import Control.Monad (void)
|
import Control.Monad (void)
|
||||||
import Control.Applicative hiding (many, (<|>), optional)
|
import Control.Applicative hiding (many, (<|>), optional)
|
||||||
|
|
|
@ -33,7 +33,20 @@
|
||||||
-- and part of the sitemap.
|
-- and part of the sitemap.
|
||||||
--
|
--
|
||||||
-- __N.B.:__ 'mkLink' assumes a capture matches any string (without slashes).
|
-- __N.B.:__ 'mkLink' assumes a capture matches any string (without slashes).
|
||||||
module Servant.Utils.Links where
|
module Servant.Utils.Links (
|
||||||
|
-- * Link and mkLink
|
||||||
|
-- | The only end-user utilities
|
||||||
|
mkLink
|
||||||
|
, Link
|
||||||
|
-- * Internal
|
||||||
|
-- | These functions will likely only be of interest if you are writing
|
||||||
|
-- more API combinators and would like to extend the behavior of
|
||||||
|
-- 'mkLink'
|
||||||
|
, ValidLinkIn()
|
||||||
|
, VLinkHelper(..)
|
||||||
|
, IsElem
|
||||||
|
, IsLink
|
||||||
|
)where
|
||||||
|
|
||||||
import Data.Proxy
|
import Data.Proxy
|
||||||
import GHC.TypeLits
|
import GHC.TypeLits
|
||||||
|
@ -94,6 +107,9 @@ instance ( IsElem f s ~ 'True
|
||||||
, VLinkHelper f) => ValidLinkIn f s where
|
, VLinkHelper f) => ValidLinkIn f s where
|
||||||
mkLink _ _ = Link (vlh (Proxy :: Proxy f))
|
mkLink _ _ = Link (vlh (Proxy :: Proxy f))
|
||||||
|
|
||||||
|
-- | A safe link datatype.
|
||||||
|
-- The only way of constructing a 'Link' is using 'mkLink', which means any
|
||||||
|
-- 'Link' is guaranteed to be part of the mentioned API.
|
||||||
data Link = Link String deriving Show
|
data Link = Link String deriving Show
|
||||||
|
|
||||||
class VLinkHelper f where
|
class VLinkHelper f where
|
||||||
|
|
Loading…
Reference in a new issue