1{-# LANGUAGE DataKinds #-}
2{-# LANGUAGE FlexibleInstances #-}
3{-# LANGUAGE MultiParamTypeClasses #-}
4{-# LANGUAGE OverloadedStrings #-}
5{-# LANGUAGE TypeFamilies #-}
6{-# LANGUAGE TypeOperators #-}
9import Data.ByteString.Lazy (ByteString)
10import Data.Text.Lazy (pack)
11import Data.Text.Lazy.Encoding (encodeUtf8)
12import Network.HTTP.Types
18type DocsAPI = T3.API :<|> Raw
20instance ToCapture (Capture "x" Int) where
21 toCapture _ = DocCapture "x" "(integer) position on the x axis"
23instance ToCapture (Capture "y" Int) where
24 toCapture _ = DocCapture "y" "(integer) position on the y axis"
26instance ToSample T3.Position where
27 toSamples _ = singleSample (T3.Position 3 14)
29instance ToParam (QueryParam "name" String) where
32 ["Alp", "John Doe", "..."]
33 "Name of the person to say hello to."
36instance ToSample T3.HelloMessage where
38 [ ("When a value is provided for 'name'", T3.HelloMessage "Hello, Alp")
39 , ("When 'name' is not specified", T3.HelloMessage "Hello, anonymous coward")
43ci = T3.ClientInfo "Alp" "alp@foo.com" 26 ["haskell", "mathematics"]
45instance ToSample T3.ClientInfo where
46 toSamples _ = singleSample ci
48instance ToSample T3.Email where
49 toSamples _ = singleSample (T3.emailForClient ci)
58 $ docsWithIntros [intro] T3.api
60 where intro = DocIntro "Welcome" ["This is our super webservice's API.", "Enjoy!"]
62server :: Server DocsAPI
63server = T3.server :<|> serveDocs
65 where serveDocs _ respond =
66 respond $ responseLBS ok200 [plain] docsBS
68 plain = ("Content-Type", "text/plain")
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list