summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authordefanor <defanor@uberspace.net>2017-12-02 06:49:58 +0300
committerdefanor <defanor@uberspace.net>2017-12-02 06:49:58 +0300
commitc84dbc16bbf683661e8323c68326ee04c8daf2fc (patch)
tree04ab0517a2dbe465ad1f0a158eae9b707fd73655 /README.md
parent4beea4536a36322e15665de74c96926f0cf5fe7b (diff)
Use GHC.Generics instead of TH
It's considerably cleaner and simpler with GHC.Generics. Megaparsec is also used now.
Diffstat (limited to 'README.md')
-rw-r--r--README.md40
1 files changed, 6 insertions, 34 deletions
diff --git a/README.md b/README.md
index 63db06d..f31d8c5 100644
--- a/README.md
+++ b/README.md
@@ -5,7 +5,11 @@ interfaces. They are like command-line user interfaces, but for
programs.
Given a type, it derives instances to print and parse it as
-command-line arguments.
+command-line arguments. The resulting serialization wouldn't be as
+nice as that of
+e.g.
+[optparse-generic](https://hackage.haskell.org/package/optparse-generic),
+but the aim here is to handle arbitrary types.
The goal is to
faciliate
@@ -16,36 +20,4 @@ architectures. Described in more detail in
the
[command-line program interface](https://defanor.uberspace.net/notes/command-line-program-interface.html) note.
-Not production-ready yet, merely a prototype.
-
-
-## Example
-
-There is an example in `Example.hs`, but here are some bits:
-
-```haskell
-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
-order:
-
-* 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.
+Far from production-ready yet, merely a prototype.