commander: pattern matching against string based commands
An extensible, format-agnostic command parsing library designed to be easy to use and syntactically light weight.
Assuming we write a parser to convert a command such as
calculator add 1 2 -v=yes
Into path and flags such as ["calculator", "add"]
and Map.fromList [("v","yes")]
,
This library will then match said path and flags against a nested record type of
commands built up using lightweight monadic syntax and tries to execute
the associated function if the matching and value converting works, or returns
an error if the path/flags fail to match any command.
To get started, see the documentation for the Commander
module
below. Additionally, an examples folder is included in the source
illustrating usage - see https://github.com/jsdw/hs-commander for
more.
[Skip to Readme]
Downloads
- commander-0.1.0.0.tar.gz [browse] (Cabal source package)
- Package description (as included in the package)
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
- No Candidates
Versions [RSS] | 0.1.0.0 |
---|---|
Dependencies | base (>=4.8 && <5), commander, containers (>=0.5 && <0.6), mtl (>=2.2 && <2.3), transformers (>=0.4.2 && <0.5) [details] |
License | BSD-3-Clause |
Copyright | (c) 2016 James Wilson |
Author | James Wilson |
Maintainer | me@unbui.lt |
Category | Text |
Home page | https://github.com/jsdw/hs-commander |
Source repo | head: git clone https://github.com/jsdw/hs-commander |
Uploaded | by jsdw at 2016-03-11T19:59:08Z |
Distributions | |
Executables | example1 |
Downloads | 868 total (1 in the last 30 days) |
Rating | (no votes yet) [estimated by Bayesian average] |
Your Rating | |
Status | Docs available [build log] Last success reported on 2016-03-11 [all 1 reports] |