From f983734975606f21ce29a649aea243b33aa67263 Mon Sep 17 00:00:00 2001 From: Alp Mestanogullari Date: Sat, 22 Nov 2014 18:59:44 +0100 Subject: [PATCH] haddocks for BaseUrl --- src/Servant/Common/BaseUrl.hs | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/Servant/Common/BaseUrl.hs b/src/Servant/Common/BaseUrl.hs index 15ef6dac..e453c855 100644 --- a/src/Servant/Common/BaseUrl.hs +++ b/src/Servant/Common/BaseUrl.hs @@ -1,6 +1,9 @@ {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE ViewPatterns #-} -module Servant.Common.BaseUrl where +module Servant.Common.BaseUrl + ( Scheme(..) + , BaseUrl (..) + ) where import Data.List import GHC.Generics @@ -8,15 +11,19 @@ import Network.URI import Safe import Text.Read -data Scheme = Http | Https +-- | URI scheme to use +data Scheme = + Http -- ^ http:// + | Https -- ^ https:// deriving (Show, Eq, Ord, Generic) -data BaseUrl = BaseUrl { - baseUrlScheme :: Scheme, - baseUrlHost :: String, - baseUrlPort :: Int - } - deriving (Show, Eq, Ord, Generic) +-- | Simple data type to represent the target of HTTP requests +-- for servant's automatically-generated clients. +data BaseUrl = BaseUrl + { baseUrlScheme :: Scheme -- ^ URI scheme to use + , baseUrlHost :: String -- ^ host (eg "haskell.org") + , baseUrlPort :: Int -- ^ port (eg 80) + } deriving (Show, Eq, Ord, Generic) showBaseUrl :: BaseUrl -> String showBaseUrl (BaseUrl urlscheme host port) =