@@ -51,7 +51,7 @@ emailForClient c = Email from' to' subject' body'
51 ++ "Since you've recently turned " ++ show (age c)
51 ++ "Since you've recently turned " ++ show (age c)
52 ++ ", have you checked out our latest "
52 ++ ", have you checked out our latest "
53 ++ intercalate ", " (interested_in c)
53 ++ intercalate ", " (interested_in c)
54− ++ " ? Give us a visit!"
54+ ++ " products? Give us a visit!"
56type API = "position" :> Capture "x" Int :> Capture "y" Int :> Get '[JSON] Position
56type API = "position" :> Capture "x" Int :> Capture "y" Int :> Get '[JSON] Position
57 :<|> "hello" :> QueryParam "name" String :> Get '[JSON] HelloMessage
57 :<|> "hello" :> QueryParam "name" String :> Get '[JSON] HelloMessage
@@ -65,15 +65,15 @@ server = position
65 :<|> hello
65 :<|> hello
66 :<|> marketing
66 :<|> marketing
68− where position :: Int -> Int -> EitherT Int IO Position
68+ where position :: Int -> Int -> EitherT ServantErr IO Position
69 position x y = return (Position x y)
69 position x y = return (Position x y)
71− hello :: Maybe String -> EitherT Int IO HelloMessage
71+ hello :: Maybe String -> EitherT ServantErr IO HelloMessage
72 hello mname = return . HelloMessage $ case mname of
72 hello mname = return . HelloMessage $ case mname of
73 Nothing -> "Hello, anonymous coward"
73 Nothing -> "Hello, anonymous coward"
74 Just n -> "Hello, " ++ n
74 Just n -> "Hello, " ++ n
76− marketing :: ClientInfo -> EitherT Int IO Email
76+ marketing :: ClientInfo -> EitherT ServantErr IO Email
77 marketing clientinfo = return (emailForClient clientinfo)
77 marketing clientinfo = return (emailForClient clientinfo)
79app :: Application
79app :: Application