Skip to content

Commit 06217ac

Browse files
author
Catherine Galkina
committed
Fix typos in examples
1 parent 682d7ea commit 06217ac

File tree

1 file changed

+28
-30
lines changed

1 file changed

+28
-30
lines changed

servant-client/src/Servant/Client/Generic.hs

Lines changed: 28 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -21,36 +21,34 @@ import Servant.Client (ClientM)
2121
--
2222
-- Example:
2323
--
24-
-- @
25-
-- type API
26-
-- = "foo" :> Capture "x" Int :> Get '[JSON] Int
27-
-- :<|> "bar" :> QueryParam "a" Char :> QueryParam "b" String :> Post '[JSON] [Int]
28-
-- :<|> Captre "nested" Int :> NestedAPI
29-
--
30-
-- type NestedAPI
31-
-- = Get '[JSON] String
32-
-- :<|> "baz" :> QueryParam "c" Char :> Post '[JSON] ()
33-
--
34-
-- data APIClient = APIClient
35-
-- { getFoo :: Int -> ClientM Int
36-
-- , postBar :: Maybe Char -> Maybe String -> ClientM [Int]
37-
-- , mkNestedClient :: Int -> NestedClient
38-
-- } deriving GHC.Generic
39-
--
40-
-- instance Generic.SOP.Generic APIClient
41-
-- instance (Client API ~ client) => ClientLike client APIClient
42-
--
43-
-- data NestedClient = NestedClient
44-
-- { getString :: ClientM String
45-
-- , postBaz :: Maybe Char -> ClientM ()
46-
-- } deriving GHC.Generic
47-
--
48-
-- instance Generic.SOP.Generic
49-
-- instance (Client NestedAPI ~ client) => ClientLike client NestedAPI
50-
--
51-
-- mkAPIClient :: APIClient
52-
-- mkAPIClient = mkClient (client (Proxy :: Proxy API))
53-
-- @
24+
-- > type API
25+
-- > = "foo" :> Capture "x" Int :> Get '[JSON] Int
26+
-- > :<|> "bar" :> QueryParam "a" Char :> QueryParam "b" String :> Post '[JSON] [Int]
27+
-- > :<|> Capture "nested" Int :> NestedAPI
28+
-- >
29+
-- > type NestedAPI
30+
-- > = Get '[JSON] String
31+
-- > :<|> "baz" :> QueryParam "c" Char :> Post '[JSON] ()
32+
-- >
33+
-- > data APIClient = APIClient
34+
-- > { getFoo :: Int -> ClientM Int
35+
-- > , postBar :: Maybe Char -> Maybe String -> ClientM [Int]
36+
-- > , mkNestedClient :: Int -> NestedClient
37+
-- > } deriving GHC.Generic
38+
-- >
39+
-- > instance Generic.SOP.Generic APIClient
40+
-- > instance (Client API ~ client) => ClientLike client APIClient
41+
-- >
42+
-- > data NestedClient = NestedClient
43+
-- > { getString :: ClientM String
44+
-- > , postBaz :: Maybe Char -> ClientM ()
45+
-- > } deriving GHC.Generic
46+
-- >
47+
-- > instance Generic.SOP.Generic
48+
-- > instance (Client NestedAPI ~ client) => ClientLike client NestedClient
49+
-- >
50+
-- > mkAPIClient :: APIClient
51+
-- > mkAPIClient = mkClient (client (Proxy :: Proxy API))
5452
class ClientLike client custom where
5553
mkClient :: client -> custom
5654
default mkClient :: (Generic custom, GClientLikeP client xs, SOP I '[xs] ~ Rep custom)

0 commit comments

Comments
 (0)