http2-client-grpc: Implement gRPC-over-HTTP2 clients.

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.


A gRPC over http2-client using proto-lens to generate client code.

[Skip to ReadMe]


Dependenciesasync (==2.2.*), base (>=4.11 && <5), binary (==0.8.*), bytestring (==0.10.8.*), case-insensitive (>=1.2.0 && <1.3), data-default-class (==0.1.*), http2 (==1.6.*), http2-client (==0.8.*), http2-grpc-types (==0.3.*), lens (==4.16.*), proto-lens (==0.3.*), proto-lens-protoc (==0.3.*), text (==1.2.*), tls (==1.4.*) [details]
Copyright2017 Lucas DiCioccio
AuthorLucas DiCioccio
Home page
Source repositoryhead: git clone
UploadedTue Sep 11 17:58:58 UTC 2018 by LucasDiCioccio




Maintainers' corner

For package maintainers and hackage trustees

Readme for http2-client-grpc-

[back to package description]


A native HTTP2 gRPC client library using proto-lens and http2-client.


This project provides a library that leverages the code generated using proto-lens (in particular, proto-lens-protoc) to implement the client-side of gRPC services.



In addition to a working Haskell dev environment, you need to:

Adding .proto files to a Haskell package

In order to run gRPC:

A single protoc invocation may be enough for both Proto and GRPC outputs:

protoc  "--plugin=protoc-gen-haskell-protolens=${protolens}" \
    --haskell-protolens_out=./gen \
    -I "${protodir1} \
    -I "${protodir2} \
    ${first.proto} \

A reliable way to list the module names is the following bash invocation:

find gen -name "*.hs" | sed -e 's/gen\///' | sed -e 's/\.hs$//' | tr '/' '.'

Unlike proto-lens, this project does not yet provide a modified Setup.hs. As a result, we cannot automate these steps from within Cabal/Stack. Hence, you'll have to automate these steps outside your Haskell toolchain.

Calling a GRPC service

In short, use http2-client with the function and let the types guide you.


You'll find an example leveraging the awesome service at .

gRPC service mapping

The Protobuf format specifies the notion of Service which can have one or more RPCs. The gRPC protocal maps these services onto HTTP2 headers and HTTP2 frames. In general, gRPC implementation generate one inlined function per RPC. This implementation differs by decoupling the HTTP2 transport and leveraging generics to provide generic functions. This design allows the to be type safe and multi-usage. For instance, you can wrap this function with whatever metrics/benchmark code and have all your RPC calls be monitored in a uniform way.


This library is currently an early-stage library. Expect breaking changes.

Next steps