butcher/nix
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
..
.gitignore Fix/Upgrade/Improve nix expressions 2020-08-23 17:11:38 +02:00
README.md Add nix expressions 2020-06-09 00:13:03 +02:00
all.nix Major changeset: Add applicative, Refactor monadic interface 2020-10-06 10:56:55 +02:00
ci.sh Add nix expressions 2020-06-09 00:13:03 +02:00
create-roots.sh Fix/Upgrade/Improve nix expressions 2020-08-23 17:11:38 +02:00
via-hackage.nix Fix/Upgrade/Improve nix expressions 2020-08-23 17:11:38 +02:00
via-stackage.nix Fix/Upgrade/Improve nix expressions 2020-08-23 17:11:38 +02:00

README.md

This nix setup expects the iohk haskell-nix overlay to be available/included when importing <nixpkgs>. Also, you might need a specific commit if you want to test against all supported ghcs (8.4 - 8.10, currently).

Useful commands:

# enter a shell for a specific build-plan
# (cabal-solved with ghc-8.4 in this case)
nix-shell nix/all.nix -A '"hackage-8.4".shell'
# run tests against ghcs 8.4 through 8.10, both against hackage and stackage package sets
nix/ci.sh

Files in this directory:

all.nix - main entrypoint into this package's nix world via-hackage.nix - how to build this via cabal-solved package-set via-stackage.nix - how to build via stackage-based package set nixpkgs.nix - optional - if you want to use a custom nixpkgs channel (the replacement needs to have haskell-nix overlay and the cabal-check feature enabled though!) local-extra-deps.nix - optional - for defining local addition deps for dev testing

(plus some currently unused:)

materialized - materializations of cabal-solved build-plans plan.nix - manual materialization of unsolved build-plan (used with stackage snapshot to build package set)