path: root/
diff options
authordefanor <>2016-11-25 06:35:55 +0300
committerdefanor <>2016-11-25 06:35:55 +0300
commit4beea4536a36322e15665de74c96926f0cf5fe7b (patch)
tree3fbf95944351b0ceaf4c925715ee9bec4069fb7d /
Initial commit
Diffstat (limited to '')
1 files changed, 51 insertions, 0 deletions
diff --git a/ b/
new file mode 100644
index 0000000..63db06d
--- /dev/null
+++ b/
@@ -0,0 +1,51 @@
+# Coalpit
+Coalpit is a library for building command-line program
+interfaces. They are like command-line user interfaces, but for
+Given a type, it derives instances to print and parse it as
+command-line arguments.
+The goal is to
+[the KISS principle](
+preservation for interfaces between system components in certain
+(rather [unixy](
+architectures. Described in more detail in
+[command-line program interface]( note.
+Not production-ready yet, merely a prototype.
+## Example
+There is an example in `Example.hs`, but here are some bits:
+data Y = Foo Bool Int
+ | Bar Int
+ | Baz
+data X = X String (Maybe Int) (Maybe [Int]) Y Y String
+$(deriveArgs ''Y)
+$(deriveArgs ''X)
+`toArgs` serializes data into arguments, and `fromArgs` deserializes
+it: `X "test" Nothing (Just [1,2,3]) (Foo True 1) Baz "end"` ↔ `x
+"test" n j 1,2,3 foo t 1 baz "end"`.
+## TODO
+What it currently lacks, but what should be done, roughly in that
+* Proper parsing: use optparse-applicative, Parsec, or a custom
+ parser, but something with error handling and more flexible.
+* Named arguments (via records), not just positional ones.
+* Optional arguments: once the named ones will be there, `Maybe a`
+ could be handled nicer.
+* Help messages.
+* Documentation.