@@ -4,7 +4,7 @@
4{-# LANGUAGE FlexibleInstances #-}
4{-# LANGUAGE FlexibleInstances #-}
5{-# LANGUAGE OverloadedStrings #-}
5{-# LANGUAGE OverloadedStrings #-}
6{-# LANGUAGE MultiParamTypeClasses #-}
6{-# LANGUAGE MultiParamTypeClasses #-}
7−module GS10 where
7+module T10 where
9import Data.ByteString.Lazy (ByteString)
9import Data.ByteString.Lazy (ByteString)
10import Data.Text.Lazy (pack)
10import Data.Text.Lazy (pack)
@@ -13,9 +13,9 @@ import Network.HTTP.Types
13import Network.Wai
13import Network.Wai
14import Servant
14import Servant
15import Servant.Docs
15import Servant.Docs
16−import qualified GS3
16+import qualified T3
18−type DocsAPI = GS3.API :<|> Raw
18+type DocsAPI = T3.API :<|> Raw
20instance ToCapture (Capture "x" Int) where
20instance ToCapture (Capture "x" Int) where
21 toCapture _ = DocCapture "x" "(integer) position on the x axis"
21 toCapture _ = DocCapture "x" "(integer) position on the x axis"
@@ -23,8 +23,8 @@ instance ToCapture (Capture "x" Int) where
23instance ToCapture (Capture "y" Int) where
23instance ToCapture (Capture "y" Int) where
24 toCapture _ = DocCapture "y" "(integer) position on the y axis"
24 toCapture _ = DocCapture "y" "(integer) position on the y axis"
26−instance ToSample GS3.Position GS3.Position where
26+instance ToSample T3.Position T3.Position where
27− toSample _ = Just (GS3.Position 3 14)
27+ toSample _ = Just (T3.Position 3 14)
29instance ToParam (QueryParam "name" String) where
29instance ToParam (QueryParam "name" String) where
30 toParam _ =
30 toParam _ =
@@ -33,20 +33,20 @@ instance ToParam (QueryParam "name" String) where
33 "Name of the person to say hello to."
33 "Name of the person to say hello to."
36−instance ToSample GS3.HelloMessage GS3.HelloMessage where
36+instance ToSample T3.HelloMessage T3.HelloMessage where
37 toSamples _ =
37 toSamples _ =
38− [ ("When a value is provided for 'name'", GS3.HelloMessage "Hello, Alp")
38+ [ ("When a value is provided for 'name'", T3.HelloMessage "Hello, Alp")
39− , ("When 'name' is not specified", GS3.HelloMessage "Hello, anonymous coward")
39+ , ("When 'name' is not specified", T3.HelloMessage "Hello, anonymous coward")
42−ci :: GS3.ClientInfo
42+ci :: T3.ClientInfo
43−ci = GS3.ClientInfo "Alp" "alp@foo.com" 26 ["haskell", "mathematics"]
43+ci = T3.ClientInfo "Alp" "alp@foo.com" 26 ["haskell", "mathematics"]
45−instance ToSample GS3.ClientInfo GS3.ClientInfo where
45+instance ToSample T3.ClientInfo T3.ClientInfo where
46 toSample _ = Just ci
46 toSample _ = Just ci
48−instance ToSample GS3.Email GS3.Email where
48+instance ToSample T3.Email T3.Email where
49− toSample _ = Just (GS3.emailForClient ci)
49+ toSample _ = Just (T3.emailForClient ci)
51api :: Proxy DocsAPI
51api :: Proxy DocsAPI
52api = Proxy
52api = Proxy
@@ -55,12 +55,12 @@ docsBS :: ByteString
55docsBS = encodeUtf8
55docsBS = encodeUtf8
57 . markdown
57 . markdown
58− $ docsWithIntros [intro] GS3.api
58+ $ docsWithIntros [intro] T3.api
60 where intro = DocIntro "Welcome" ["This is our super webservice's API.", "Enjoy!"]
60 where intro = DocIntro "Welcome" ["This is our super webservice's API.", "Enjoy!"]
62server :: Server DocsAPI
62server :: Server DocsAPI
63−server = GS3.server :<|> serveDocs
63+server = T3.server :<|> serveDocs
65 where serveDocs _ respond =
65 where serveDocs _ respond =
66 respond $ responseLBS ok200 [plain] docsBS
66 respond $ responseLBS ok200 [plain] docsBS