Commit Graph

16 Commits (7d151ac2fa75b0fa020407719a0a7bc3166350b0)

Author SHA1 Message Date
Lennart Spitzner 7d151ac2fa Clean up haddocks 2020-10-06 10:56:55 +02:00
Lennart Spitzner 6604a9746c Major changeset: Add applicative, Refactor monadic interface
- monadic interface now uses two-phase setup: First step is to create a
  full CommandDesc value, second is running the parser on input while the
  CommandDesc is chained along
- applicative interface has a somewhat nicer/cleaner implementation, is
  more secure by avoiding any demands on the API user that are not encoded
  in types, but is slightly less expressive and requires ApplicativeDo to
  get readable code.
- The applicative interface is *NOT* finished and the test-suite does not
  cover it.
- Add the `traverseBarbie` construct which introduces a dependency on
  the `barbies` library. This also effectively:
- Stop support for ghc < 8.4.
- Refactor the module structure a bit, and change the API of the central
  `runCmdParser` function. It now returns a `PartialParseInfo`. Essentially,
  `runCmdParser` is a combination of the previous `runCmdParser` and the
  previous `simpleCompletion`. This API design is a curious advantage to
  laziness: Returning a complex struct is harmless as fields that the user
  does not use won't be evaluated. The downside is that the core function now
  looks like a complex beast, but the upside is that there is no need to
  expose multiple functions that are supposed to be chained in a certain way
  to get all functionality (if desired), and we still _can_ provide simpler
  versions that are just projections on the `PartialParseInfo`.
- Stop support for an anti-feature: The implicit merging of multiple
  sub-commands definitions with the same name.
2020-10-06 10:56:55 +02:00
Lennart Spitzner ded3192962 Simplify/Clean up prelude.inc 2020-04-10 23:31:47 +02:00
Lennart Spitzner c16eefdb0e Fix some -Wcompat issues (MFP) 2018-10-03 22:08:09 +02:00
Lennart Spitzner e0dd252707 Adapt to ghc-8.4, Drop support for ghc<8 2018-04-13 20:47:08 +02:00
Lennart Spitzner a495e13e53 Add addHelpCommandWith; Improve layouting for help/docs 2018-01-12 23:16:20 +01:00
Lennart Spitzner e1c38e430f Support hiding flags 2018-01-10 22:39:40 +01:00
Lennart Spitzner b2a25f3a07 Rename param functions, Add `addParamNoFlagString*`, Fix flag behaviour 2017-10-03 17:06:15 +02:00
Lennart Spitzner 12b886ad31 Allow --flag=value syntax in addition to --flag value 2017-05-16 21:02:01 +02:00
Lennart Spitzner b15f1ae585 Refactor module structure; Add haddock; Update README 2017-01-01 14:46:53 +01:00
Lennart Spitzner 11db0a98ab Fix InputString parsing for addFlagStringParam function family 2016-12-30 22:16:04 +01:00
Lennart Spitzner 04cb0bdea5 Clean up imports; Reduce dep footprint s/lens/microlens/ 2016-10-11 00:27:26 +02:00
Lennart Spitzner 37fa57dfc2 Create `addFlagFooParam` variants matching exactly once (breaking change)
- addFlagReadParams was previously named addFlagReadParam, similarly
  addFlagStringParams/addFlagStringParam.
- The "singular" variants have semantics that did not exist before:
  to match exactly once and thus having type `CmdParser f out p` instead
  of `CmdParser f out [p]`.
2016-09-29 21:31:27 +02:00
Lennart Spitzner 4b7f8681e7 Fix addFlagReadParamAll for InputArgs case 2016-08-03 22:57:08 +02:00
Lennart Spitzner 7132a79b50 Add project-spec. prelude; Remove q-prelude dependency 2016-07-30 16:44:31 +02:00
Lennart Spitzner f033c9e0ab Rename to butcher, Change everything else 2016-07-30 16:25:28 +02:00