Skip to content

Latest commit

 

History

History
44 lines (31 loc) · 1.71 KB

README.md

File metadata and controls

44 lines (31 loc) · 1.71 KB

cqg-api-client

This repo contains Haskell packages for working with CQG's APIs:

Viewing Documentation for Generated Haskell Modules

In order to figure out how to use the generated Haskell modules, you'll find the following pieces of documentation helpful:

  • The proto-lens tutorial. This is somewhat brief, but touches on most aspects of using proto-lens.

  • The Haddocks of the generated Haskell modules. You can generate the Haddocks with the command:

    $ stack haddock
  • The raw .proto files themselves, for instance in [./cqg-cms-api-proto/proto]. The .proto files also contain helpful comments that don't get generated in the Haddocks.

    Once you understand how the translation works between the .proto files and the Haskell modules, it is often easier to just read the .proto files instead of the Haddocks.

  • Any example code from CQG for working with their APIs. For instance, there is an example Protobuf-based Python project for working with the CQG CMS API. Translating the Python examples to Haskell is at least somewhat straightforward.

Regenerating Haskell Modules

You can redownload the protobuf files for CQG's APIs, and then regenerate the Haskell modules with the following command. This is a nix-shell script, so make sure you have Nix installed before running this command:

$ ./generate.sh