protobuf-simple: Simple Protocol Buffers library (proto2)
An Haskell implementation of Google's Protocol Buffers version 2 with an emphasis on simplicity. The implementation consists of a library for encoding and decoding of data and the `protobuf-simple-protoc` executable for generating Haskell types from proto files. In fact, the types that are used in the tests are generated with the following command:
$ protobuf-simple-protoc data/Types.proto
In the example below, the CustomType
is a Haskell type that was generated
with the `protobuf-simple-protoc` executable. The encCustomType
function
encodes a CustomType into a ByteString. The decCustomType
function
decodes a ByteString into either a CustomType or an error.
module Codec where import Data.ByteString.Lazy (ByteString) import Data.ProtoBuf (decode, encode) import Types.CustomType (CustomType(..)) encCustomType :: CustomType -> ByteString encCustomType = encode decCustomType :: ByteString -> Either String CustomType decCustomType = decode
The library exposes two modules, Data.ProtoBuf, which is used for encoding and decoding and Data.ProtoBufInt, which is an internal module that is used by the generated types.
[Skip to Readme]
Downloads
- protobuf-simple-0.1.1.1.tar.gz [browse] (Cabal source package)
- Package description (as included in the package)
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
Versions [RSS] | 0.1.0.0, 0.1.0.1, 0.1.0.2, 0.1.0.3, 0.1.0.4, 0.1.0.5, 0.1.1.0, 0.1.1.1 |
---|---|
Dependencies | base (>=4 && <5), binary (>=0.7), bytestring (>=0.9), containers (>=0.4), data-binary-ieee754 (>=0.4), directory, filepath, mtl (>=2.0), parsec, split, text (>=0.11) [details] |
License | MIT |
Copyright | (c) 2015-2016 Martijn Rijkeboer <mrr@sru-systems.com> |
Author | Martijn Rijkeboer <mrr@sru-systems.com> |
Maintainer | Martijn Rijkeboer <mrr@sru-systems.com> |
Category | Data |
Home page | https://github.com/sru-systems/protobuf-simple |
Source repo | head: git clone https://github.com/sru-systems/protobuf-simple |
Uploaded | by mrijkeboer at 2021-07-18T14:09:37Z |
Distributions | LTSHaskell:0.1.1.1, NixOS:0.1.1.1, Stackage:0.1.1.1 |
Reverse Dependencies | 1 direct, 0 indirect [details] |
Executables | protobuf-simple-protoc |
Downloads | 5893 total (15 in the last 30 days) |
Rating | (no votes yet) [estimated by Bayesian average] |
Your Rating | |
Status | Docs available [build log] Last success reported on 2021-07-18 [all 1 reports] |