git.iko.soy/typeable/servant
on master help sign in
Documentation fixes
da83378Julian K. Arni
doc/tutorial/Client.lhs+4−4
@@ -128,15 +128,15 @@ That's it. Let's now write some code that uses our client functions.
128``` haskell
128``` haskell
129queries :: ClientM (Position, HelloMessage, Email)
129queries :: ClientM (Position, HelloMessage, Email)
130queries = do
130queries = do
131− pos <- position 10 10
131+ pos <- position 10 10
132− message <- hello (Just "servant")
132+ message <- hello (Just "servant")
133 em <- marketing (ClientInfo "Alp" "alp@foo.com" 26 ["haskell", "mathematics"])
133 em <- marketing (ClientInfo "Alp" "alp@foo.com" 26 ["haskell", "mathematics"])
134 return (pos, message, em)
134 return (pos, message, em)
135
135
136run :: IO ()
136run :: IO ()
137run = do
137run = do
138− manager <- newManager defaultManagerSettings
138+ manager' <- newManager defaultManagerSettings
139− res <- runClientM queries (ClientEnv manager (BaseUrl Http "localhost" 8081 ""))
139+ res <- runClientM queries (ClientEnv manager' (BaseUrl Http "localhost" 8081 ""))
140 case res of
140 case res of
141 Left err -> putStrLn $ "Error: " ++ show err
141 Left err -> putStrLn $ "Error: " ++ show err
142 Right (pos, message, em) -> do
142 Right (pos, message, em) -> do
servant-client-core/CHANGELOG.md+3−2
@@ -1,5 +1,6 @@
1# Revision history for servant-client-core
1# Revision history for servant-client-core
2
2
3−## 0.11 -- YYYY-mm-dd
3+## 0.12 -- YYYY-mm-dd
4
4
5−* First version. Released on an unsuspecting world.
5+* First version. Factored out of servant-client all the functionality that was
6+independent of the http-client backend.
servant-client-core/README.md+1−1
@@ -10,7 +10,7 @@ This library should mainly be of interest to backend- and combinator-writers.
10
10
11If you are creating a new backend, you'll need to:
11If you are creating a new backend, you'll need to:
12
12
13−1. Define a `RunClient` instance for your datatype (call it 'MyMonad')
13+1. Define a `RunClient` instance for your datatype (call it `MyMonad`)
142. Define a `ClientLike` instance. This will look like:
142. Define a `ClientLike` instance. This will look like:
15
15
16``` haskell
16``` haskell
servant-client-core/servant-client-core.cabal+7−6
@@ -51,14 +51,15 @@ library
51 , text >= 1.2 && < 1.3
51 , text >= 1.2 && < 1.3
52 hs-source-dirs: src
52 hs-source-dirs: src
53 default-language: Haskell2010
53 default-language: Haskell2010
54+ ghc-options: -Wall
54− include-dirs: include
55+ include-dirs: include
55
56
56test-suite spec
57test-suite spec
57− type: exitcode-stdio-1.0
58+ type: exitcode-stdio-1.0
58− ghc-options: -Wall
59+ ghc-options: -Wall
59− default-language: Haskell2010
60+ default-language: Haskell2010
60− hs-source-dirs: test
61+ hs-source-dirs: test
61− main-is: Spec.hs
62+ main-is: Spec.hs
62 build-depends:
63 build-depends:
63 base
64 base
64 , base-compat
65 , base-compat
servant-client/src/Servant/Client.hs+2−2
@@ -6,8 +6,8 @@ module Servant.Client
6 , ClientM
6 , ClientM
7 , runClientM
7 , runClientM
8 , ClientEnv(..)
8 , ClientEnv(..)
9− , module X
9+ , module Servant.Client.Core.Reexport
10 ) where
10 ) where
11
11
12import Servant.Client.Internal.HttpClient
12import Servant.Client.Internal.HttpClient
13−import Servant.Client.Core.Reexport as X
13+import Servant.Client.Core.Reexport
servant-client/src/Servant/Client/Internal/HttpClient.hs+1−1
@@ -65,7 +65,7 @@ client :: HasClient ClientM api => Proxy api -> Client ClientM api
65client api = api `clientIn` (Proxy :: Proxy ClientM)
65client api = api `clientIn` (Proxy :: Proxy ClientM)
66
66
67-- | @ClientM@ is the monad in which client functions run. Contains the
67-- | @ClientM@ is the monad in which client functions run. Contains the
68−-- 'Manager' and 'BaseUrl' used for requests in the reader environment.
68+-- 'Client.Manager' and 'BaseUrl' used for requests in the reader environment.
69newtype ClientM a = ClientM
69newtype ClientM a = ClientM
70 { runClientM' :: ReaderT ClientEnv (ExceptT ServantError IO) a }
70 { runClientM' :: ReaderT ClientEnv (ExceptT ServantError IO) a }
71 deriving ( Functor, Applicative, Monad, MonadIO, Generic
71 deriving ( Functor, Applicative, Monad, MonadIO, Generic