git.iko.soy/typeable/servant
on master help sign in
adapt examples to baseurl fix
commite0f4ed64261ff163d0e35da73c686690660db33a authorAlp Mestanogullari <alpmestan@gmail.com> dateSat 9 May 2015, 17:31 (11 years ago) parenta403eee
1 file changed+4−7
servant-examples/getting-started/GS8.hs+4−7
servant-examples/getting-started/GS8.hs+4−7
@@ -12,27 +12,24 @@ import GS3
1212
1313position :: Int -- ^ value for "x"
1414 -> Int -- ^ value for "y"
15− -> BaseUrl
1615 -> EitherT ServantError IO Position
1716
1817hello :: Maybe String -- ^ an optional value for "name"
19− -> BaseUrl
2018 -> EitherT ServantError IO HelloMessage
2119
2220marketing :: ClientInfo -- ^ value for the request body
23− -> BaseUrl
2421 -> EitherT ServantError IO Email
2522
26−position :<|> hello :<|> marketing = client api
23+position :<|> hello :<|> marketing = client api baseUrl
2724
2825baseUrl :: BaseUrl
2926baseUrl = BaseUrl Http "localhost" 8081
3027
3128queries :: EitherT ServantError IO (Position, HelloMessage, Email)
3229queries = do
33− pos <- position 10 10 baseUrl
34− msg <- hello (Just "servant") baseUrl
35− em <- marketing (ClientInfo "Alp" "alp@foo.com" 26 ["haskell", "mathematics"]) baseUrl
30+ pos <- position 10 10
31+ msg <- hello (Just "servant")
32+ em <- marketing (ClientInfo "Alp" "alp@foo.com" 26 ["haskell", "mathematics"])
3633 return (pos, msg, em)
3734
3835run :: IO ()