Documentation fixes
This commit is contained in:
parent
d6aee29be1
commit
da8337809b
6 changed files with 18 additions and 16 deletions
|
@ -135,8 +135,8 @@ queries = do
|
||||||
|
|
||||||
run :: IO ()
|
run :: IO ()
|
||||||
run = do
|
run = do
|
||||||
manager <- newManager defaultManagerSettings
|
manager' <- newManager defaultManagerSettings
|
||||||
res <- runClientM queries (ClientEnv manager (BaseUrl Http "localhost" 8081 ""))
|
res <- runClientM queries (ClientEnv manager' (BaseUrl Http "localhost" 8081 ""))
|
||||||
case res of
|
case res of
|
||||||
Left err -> putStrLn $ "Error: " ++ show err
|
Left err -> putStrLn $ "Error: " ++ show err
|
||||||
Right (pos, message, em) -> do
|
Right (pos, message, em) -> do
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
# Revision history for servant-client-core
|
# Revision history for servant-client-core
|
||||||
|
|
||||||
## 0.11 -- YYYY-mm-dd
|
## 0.12 -- YYYY-mm-dd
|
||||||
|
|
||||||
* First version. Released on an unsuspecting world.
|
* First version. Factored out of servant-client all the functionality that was
|
||||||
|
independent of the http-client backend.
|
||||||
|
|
|
@ -10,7 +10,7 @@ This library should mainly be of interest to backend- and combinator-writers.
|
||||||
|
|
||||||
If you are creating a new backend, you'll need to:
|
If you are creating a new backend, you'll need to:
|
||||||
|
|
||||||
1. Define a `RunClient` instance for your datatype (call it 'MyMonad')
|
1. Define a `RunClient` instance for your datatype (call it `MyMonad`)
|
||||||
2. Define a `ClientLike` instance. This will look like:
|
2. Define a `ClientLike` instance. This will look like:
|
||||||
|
|
||||||
``` haskell
|
``` haskell
|
||||||
|
|
|
@ -51,6 +51,7 @@ library
|
||||||
, text >= 1.2 && < 1.3
|
, text >= 1.2 && < 1.3
|
||||||
hs-source-dirs: src
|
hs-source-dirs: src
|
||||||
default-language: Haskell2010
|
default-language: Haskell2010
|
||||||
|
ghc-options: -Wall
|
||||||
include-dirs: include
|
include-dirs: include
|
||||||
|
|
||||||
test-suite spec
|
test-suite spec
|
||||||
|
|
|
@ -6,8 +6,8 @@ module Servant.Client
|
||||||
, ClientM
|
, ClientM
|
||||||
, runClientM
|
, runClientM
|
||||||
, ClientEnv(..)
|
, ClientEnv(..)
|
||||||
, module X
|
, module Servant.Client.Core.Reexport
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Servant.Client.Internal.HttpClient
|
import Servant.Client.Internal.HttpClient
|
||||||
import Servant.Client.Core.Reexport as X
|
import Servant.Client.Core.Reexport
|
||||||
|
|
|
@ -65,7 +65,7 @@ client :: HasClient ClientM api => Proxy api -> Client ClientM api
|
||||||
client api = api `clientIn` (Proxy :: Proxy ClientM)
|
client api = api `clientIn` (Proxy :: Proxy ClientM)
|
||||||
|
|
||||||
-- | @ClientM@ is the monad in which client functions run. Contains the
|
-- | @ClientM@ is the monad in which client functions run. Contains the
|
||||||
-- 'Manager' and 'BaseUrl' used for requests in the reader environment.
|
-- 'Client.Manager' and 'BaseUrl' used for requests in the reader environment.
|
||||||
newtype ClientM a = ClientM
|
newtype ClientM a = ClientM
|
||||||
{ runClientM' :: ReaderT ClientEnv (ExceptT ServantError IO) a }
|
{ runClientM' :: ReaderT ClientEnv (ExceptT ServantError IO) a }
|
||||||
deriving ( Functor, Applicative, Monad, MonadIO, Generic
|
deriving ( Functor, Applicative, Monad, MonadIO, Generic
|
||||||
|
|
Loading…
Reference in a new issue