on master help sign in
polish up cabal file, add a README
fe3bd99Alp Mestanogullari
README.mdnew file+22
@@ -0,0 +1,22 @@
1+# servant-client
2+
3+[![Build Status](https://secure.travis-ci.org/haskell-servant/servant-client.svg)](http://travis-ci.org/haskell-servant/servant-client)
4+
5+![servant](https://raw.githubusercontent.com/haskell-servant/servant/master/servant.png)
6+
7+This library lets you derive automatically Haskell functions that let you query each endpoint of a *servant* webservice.
8+
9+## Example
10+
11+``` haskell
12+type MyApi = "books" :> Get [Book] -- GET /books
13+ :<|> "books" :> ReqBody Book :> Post Book -- POST /books
14+
15+myApi :: Proxy MyApi
16+myApi = Proxy
17+
18+getAllBooks :: BaseUrl -> EitherT String IO [Book]
19+postNewBook :: Book -> BaseUrl -> EitherT String IO Book
20+-- 'client' allows you to produce operations to query an API from a client.
21+(getAllBooks :<|> postNewBook) = client myApi
22+```
servant-client.cabal+22−3
@@ -1,7 +1,21 @@
1name: servant-client
1name: servant-client
2version: 0.2
2version: 0.2
3−-- synopsis:
3+synopsis: automatical derivation of haskell functions that let you query servant webservices
4−-- description:
4+description:
5+ This library lets you derive automatically Haskell functions that
6+ let you query each endpoint of a <http://hackage.haskell.org/package/servant servant> webservice.
7+ .
8+ Example below.
9+ .
10+ > type MyApi = "books" :> Get [Book] -- GET /books
11+ > :<|> "books" :> ReqBody Book :> Post Book -- POST /books
12+ >
13+ > myApi :: Proxy MyApi
14+ > myApi = Proxy
15+ >
16+ > getAllBooks :: BaseUrl -> EitherT String IO [Book]
17+ > postNewBook :: Book -> BaseUrl -> EitherT String IO Book
18+ > (getAllBooks :<|> postNewBook) = client myApi
5license: BSD3
19license: BSD3
6license-file: LICENSE
20license-file: LICENSE
7author: Alp Mestanogullari, Sönke Hahn, Julian K. Arni
21author: Alp Mestanogullari, Sönke Hahn, Julian K. Arni
@@ -11,6 +25,11 @@ category: Web
11build-type: Simple
25build-type: Simple
12cabal-version: >=1.10
26cabal-version: >=1.10
13tested-with: GHC >= 7.8
27tested-with: GHC >= 7.8
28+homepage: http://haskell-servant.github.io/
29+Bug-reports: http://github.com/haskell-servant/servant-client/issues
30+source-repository head
31+ type: git
32+ location: http://github.com/haskell-servant/servant-client.git
14
33
15library
34library
16 exposed-modules:
35 exposed-modules:
@@ -34,7 +53,7 @@ library
34 , transformers
53 , transformers
35 hs-source-dirs: src
54 hs-source-dirs: src
36 default-language: Haskell2010
55 default-language: Haskell2010
37− ghc-options: -O0 -Wall
56+ ghc-options: -Wall
38
57
39test-suite spec
58test-suite spec
40 type: exitcode-stdio-1.0
59 type: exitcode-stdio-1.0