The coalpit package

This library generates parsers and printers for
given data types, in the form of command-line
arguments or DSVs – so that they can be used to
quickly get program interfaces via a shared
library, while being suitable for scripting and
as user interfaces.

Maintainer's Corner

Readme for coalpit-0.1.1.0

Coalpit

Coalpit is a library for
building
command-line program interfaces:
the goal is to get interfaces between programs quickly and easily,
while keeping them language-agnostic and more user- and shell
scripting-friendly than JSON and similar formats.

Given a type, it derives instances to print and parse it as
command-line arguments or DSVs, as well as to compose usage
instructions. The resulting deserialization wouldn't be as nice as
that of
e.g.
optparse-generic,
but the aim here is to handle more or less arbitrary types.

Warning: it is possible to run into ambiguity by defining a recursive
structure with optional named elements while using default options.
omitNamedOptions can be disabled to avoid that.

Example

An example is available in examples/Basic.hs. Given the following
Haskell value: