on master help sign in
Fix typos in examples
06217acCatherine Galkina
servant-client/src/Servant/Client/Generic.hs+28−30
@@ -21,36 +21,34 @@ import Servant.Client (ClientM)
21--
21--
22-- Example:
22-- Example:
23--
23--
24−-- @
25−-- type API
24+-- > type API
26−-- = "foo" :> Capture "x" Int :> Get '[JSON] Int
25+-- > = "foo" :> Capture "x" Int :> Get '[JSON] Int
27−-- :<|> "bar" :> QueryParam "a" Char :> QueryParam "b" String :> Post '[JSON] [Int]
26+-- > :<|> "bar" :> QueryParam "a" Char :> QueryParam "b" String :> Post '[JSON] [Int]
28−-- :<|> Captre "nested" Int :> NestedAPI
27+-- > :<|> Capture "nested" Int :> NestedAPI
29−--
28+-- >
30−-- type NestedAPI
29+-- > type NestedAPI
31−-- = Get '[JSON] String
30+-- > = Get '[JSON] String
32−-- :<|> "baz" :> QueryParam "c" Char :> Post '[JSON] ()
31+-- > :<|> "baz" :> QueryParam "c" Char :> Post '[JSON] ()
33−--
32+-- >
34−-- data APIClient = APIClient
33+-- > data APIClient = APIClient
35−-- { getFoo :: Int -> ClientM Int
34+-- > { getFoo :: Int -> ClientM Int
36−-- , postBar :: Maybe Char -> Maybe String -> ClientM [Int]
35+-- > , postBar :: Maybe Char -> Maybe String -> ClientM [Int]
37−-- , mkNestedClient :: Int -> NestedClient
36+-- > , mkNestedClient :: Int -> NestedClient
38−-- } deriving GHC.Generic
37+-- > } deriving GHC.Generic
39−--
38+-- >
40−-- instance Generic.SOP.Generic APIClient
39+-- > instance Generic.SOP.Generic APIClient
41−-- instance (Client API ~ client) => ClientLike client APIClient
40+-- > instance (Client API ~ client) => ClientLike client APIClient
42−--
41+-- >
43−-- data NestedClient = NestedClient
42+-- > data NestedClient = NestedClient
44−-- { getString :: ClientM String
43+-- > { getString :: ClientM String
45−-- , postBaz :: Maybe Char -> ClientM ()
44+-- > , postBaz :: Maybe Char -> ClientM ()
46−-- } deriving GHC.Generic
45+-- > } deriving GHC.Generic
47−--
46+-- >
48−-- instance Generic.SOP.Generic
47+-- > instance Generic.SOP.Generic
49−-- instance (Client NestedAPI ~ client) => ClientLike client NestedAPI
48+-- > instance (Client NestedAPI ~ client) => ClientLike client NestedClient
50−--
49+-- >
51−-- mkAPIClient :: APIClient
50+-- > mkAPIClient :: APIClient
52−-- mkAPIClient = mkClient (client (Proxy :: Proxy API))
51+-- > mkAPIClient = mkClient (client (Proxy :: Proxy API))
53−-- @
54class ClientLike client custom where
52class ClientLike client custom where
55 mkClient :: client -> custom
53 mkClient :: client -> custom
56 default mkClient :: (Generic custom, GClientLikeP client xs, SOP I '[xs] ~ Rep custom)
54 default mkClient :: (Generic custom, GClientLikeP client xs, SOP I '[xs] ~ Rep custom)