git.iko.soy/typeable/servant
on master help sign in
haddocks for BaseUrl
commitf983734975606f21ce29a649aea243b33aa67263 authorAlp Mestanogullari <alpmestan@gmail.com> dateSat 22 Nov 2014, 18:59 (12 years ago) parent77d5208
1 file changed+15−8
src/Servant/Common/BaseUrl.hs+15−8
src/Servant/Common/BaseUrl.hs+15−8
@@ -1,6 +1,9 @@
11{-# LANGUAGE DeriveGeneric #-}
22{-# LANGUAGE ViewPatterns #-}
3−module Servant.Common.BaseUrl where
3+module Servant.Common.BaseUrl
4+ ( Scheme(..)
5+ , BaseUrl (..)
6+ ) where
47
58import Data.List
69import GHC.Generics
@@ -8,15 +11,19 @@ import Network.URI
811import Safe
912import Text.Read
1013
11−data Scheme = Http | Https
14+-- | URI scheme to use
15+data Scheme =
16+ Http -- ^ http://
17+ | Https -- ^ https://
1218 deriving (Show, Eq, Ord, Generic)
1319
14−data BaseUrl = BaseUrl {
15− baseUrlScheme :: Scheme,
16− baseUrlHost :: String,
17− baseUrlPort :: Int
18− }
19− deriving (Show, Eq, Ord, Generic)
20+-- | Simple data type to represent the target of HTTP requests
21+-- for servant's automatically-generated clients.
22+data BaseUrl = BaseUrl
23+ { baseUrlScheme :: Scheme -- ^ URI scheme to use
24+ , baseUrlHost :: String -- ^ host (eg "haskell.org")
25+ , baseUrlPort :: Int -- ^ port (eg 80)
26+ } deriving (Show, Eq, Ord, Generic)
2027
2128showBaseUrl :: BaseUrl -> String
2229showBaseUrl (BaseUrl urlscheme host port) =