haddocks for BaseUrl

This commit is contained in:
Alp Mestanogullari 2014-11-22 18:59:44 +01:00
parent 77d52083f1
commit f983734975

View file

@ -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) =