adapt examples to baseurl fix

This commit is contained in:
Alp Mestanogullari 2015-05-09 17:31:54 +02:00
parent a403eee488
commit e0f4ed6426

View file

@ -12,27 +12,24 @@ import GS3
position :: Int -- ^ value for "x" position :: Int -- ^ value for "x"
-> Int -- ^ value for "y" -> Int -- ^ value for "y"
-> BaseUrl
-> EitherT ServantError IO Position -> EitherT ServantError IO Position
hello :: Maybe String -- ^ an optional value for "name" hello :: Maybe String -- ^ an optional value for "name"
-> BaseUrl
-> EitherT ServantError IO HelloMessage -> EitherT ServantError IO HelloMessage
marketing :: ClientInfo -- ^ value for the request body marketing :: ClientInfo -- ^ value for the request body
-> BaseUrl
-> EitherT ServantError IO Email -> EitherT ServantError IO Email
position :<|> hello :<|> marketing = client api position :<|> hello :<|> marketing = client api baseUrl
baseUrl :: BaseUrl baseUrl :: BaseUrl
baseUrl = BaseUrl Http "localhost" 8081 baseUrl = BaseUrl Http "localhost" 8081
queries :: EitherT ServantError IO (Position, HelloMessage, Email) queries :: EitherT ServantError IO (Position, HelloMessage, Email)
queries = do queries = do
pos <- position 10 10 baseUrl pos <- position 10 10
msg <- hello (Just "servant") baseUrl msg <- hello (Just "servant")
em <- marketing (ClientInfo "Alp" "alp@foo.com" 26 ["haskell", "mathematics"]) baseUrl em <- marketing (ClientInfo "Alp" "alp@foo.com" 26 ["haskell", "mathematics"])
return (pos, msg, em) return (pos, msg, em)
run :: IO () run :: IO ()