1{-# LANGUAGE DataKinds #-}
2{-# LANGUAGE TypeFamilies #-}
3{-# LANGUAGE TypeOperators #-}
6import Control.Monad.Trans.Except
7import Network.HTTP.Client (Manager, defaultManagerSettings,
11import System.IO.Unsafe (unsafePerformIO)
15position :: Int -- ^ value for "x"
16 -> Int -- ^ value for "y"
17 -> ExceptT ServantError IO Position
19hello :: Maybe String -- ^ an optional value for "name"
20 -> ExceptT ServantError IO HelloMessage
22marketing :: ClientInfo -- ^ value for the request body
23 -> ExceptT ServantError IO Email
25position :<|> hello :<|> marketing = client api baseUrl manager
28baseUrl = BaseUrl Http "localhost" 8081 ""
30{-# NOINLINE manager #-}
32manager = unsafePerformIO $ newManager defaultManagerSettings
34queries :: ExceptT ServantError IO (Position, HelloMessage, Email)
37 msg <- hello (Just "servant")
38 em <- marketing (ClientInfo "Alp" "alp@foo.com" 26 ["haskell", "mathematics"])
43 res <- runExceptT queries
45 Left err -> putStrLn $ "Error: " ++ show err
46 Right (pos, msg, em) -> do
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