8000 GitHub - meiersi/ghcjs-servant-client: A servant client written for GHCJS
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

meiersi/ghcjs-servant-client

 
 

Repository files navigation

servant-client

servant

This library lets you automatically derive Haskell functions that let you query each endpoint of a servant webservice.

Example

type MyApi = "books" :> Get '[JSON] [Book] -- GET /books
        :<|> "books" :> ReqBody Book :> Post '[JSON] Book -- POST /books

myApi :: Proxy MyApi
myApi = Proxy

getAllBooks :: EitherT String IO [Book]
postNewBook :: Book -> EitherT String IO Book
-- 'client' allows you to produce operations to query an API from a client.
(getAllBooks :<|> postNewBook) = client myApi host
  where host = BaseUrl Http "localhost" 8080

About

A servant client written for GHCJS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Haskell 98.5%
  • Shell 1.5%
0