From f4f86520bc1a65a8663f10aefcc7704b0dc6e5aa Mon Sep 17 00:00:00 2001 From: "Julian K. Arni" Date: Wed, 10 Dec 2014 10:34:49 +0100 Subject: [PATCH] Clean up QQ and Utils.Links haddock. --- src/Servant/QQ.hs | 2 +- src/Servant/Utils/Links.hs | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/Servant/QQ.hs b/src/Servant/QQ.hs index a886c90f..f6331f54 100644 --- a/src/Servant/QQ.hs +++ b/src/Servant/QQ.hs @@ -26,7 +26,7 @@ -- @ -- -- Note the @/@ before a @QueryParam@! -module Servant.QQ where +module Servant.QQ (sitemap) where import Control.Monad (void) import Control.Applicative hiding (many, (<|>), optional) diff --git a/src/Servant/Utils/Links.hs b/src/Servant/Utils/Links.hs index 547a3555..f2f4fe82 100644 --- a/src/Servant/Utils/Links.hs +++ b/src/Servant/Utils/Links.hs @@ -33,7 +33,20 @@ -- and part of the sitemap. -- -- __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 GHC.TypeLits @@ -94,6 +107,9 @@ instance ( IsElem f s ~ 'True , VLinkHelper f) => ValidLinkIn f s where 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 class VLinkHelper f where