diff --git a/.gitignore b/.gitignore index 059e5be..7c95f5e 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,6 @@ cabal.project.local~ cabal.sandbox.config dist dist-* + +## Nix stuff: +/result diff --git a/README.md b/README.md index 08567de..7e1e472 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,28 @@ *haspara* is a Haskell library that provides monetary definitions and a rudimentary (and experimental) accounting functionality. +## Supported GHC Versions + +1. `ghc90` +1. `ghc92` + +At the moment, there is no particular reason for not supporting +`ghc94` except that required settings are not done yet in Nix support +files, in particular for Cabal dependency. + +## Testing Against GHC Versions + +You can use Nix support to test against different GHC versions: + +```sh +nix-build --arg compiler "\"ghc92\"" +nix-build --arg compiler "\"ghc90\"" +``` + +`nix-build` command will default to `ghc90`. Check `./default.nix` +file for the default `ghc` version in case that this documentation is +out of date. + ## Development Before committing code to repository, reformat the code: @@ -65,6 +87,8 @@ weeder --require-hs-files cabal build -O0 cabal test -O0 cabal haddock -O0 + nix-build --arg compiler "\"ghc92\"" + nix-build --arg compiler "\"ghc90\"" ``` 4. Update [CHANGELOG.md](./CHANGELOG.md) file: diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..842a4b7 --- /dev/null +++ b/default.nix @@ -0,0 +1,9 @@ +{ compiler ? "ghc90" +, ... +}: + + +let + nix = import ./nix { compiler = compiler; }; +in +nix.thisPackage diff --git a/haspara.cabal b/haspara.cabal index a97e38e..11e4c19 100644 --- a/haspara.cabal +++ b/haspara.cabal @@ -54,15 +54,15 @@ library , containers >=0.6.4.1 && <0.7 , data-default ==0.7.* , exceptions >=0.10.4 && <0.11 - , hashable >=1.3.0.0 && <1.4 + , hashable >=1.3.0.0 && <1.5 , megaparsec >=9.0.1 && <9.3 , mtl >=2.2.2 && <2.3 , refined >=0.6.3 && <0.7 , safe-decimal >=0.2.1.0 && <0.3 , scientific >=0.3.7.0 && <0.4 - , template-haskell >=2.16.0.0 && <2.18 + , template-haskell >=2.16.0.0 && <2.19 , text >=1.2.4.1 && <1.3 - , time >=1.9.3 && <1.10 + , time >=1.9.3 && <1.12 default-language: Haskell2010 test-suite haspara-doctest diff --git a/nix/default.nix b/nix/default.nix index 5c11875..f34213e 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -20,7 +20,7 @@ let }; ## Get this package: - thisPackage = haskell.callCabal2nixWithOptions "haspara" ../. "--no-haddock" { }; + thisPackage = haskell.callCabal2nix "haspara" ../. { }; ## Get this package's Haskell dependencies: thisPackageDeps = pkgs.haskell.lib.compose.getHaskellBuildInputs thisPackage; diff --git a/package.yaml b/package.yaml index 274a163..8bf356c 100644 --- a/package.yaml +++ b/package.yaml @@ -27,15 +27,15 @@ library: - containers >=0.6.4.1 && <0.7 - data-default >= 0.7 && <0.8 - exceptions >=0.10.4 && <0.11 - - hashable >=1.3.0.0 && <1.4 + - hashable >=1.3.0.0 && <1.5 - megaparsec >=9.0.1 && <9.3 - mtl >=2.2.2 && <2.3 - refined >=0.6.3 && <0.7 - safe-decimal >=0.2.1.0 && <0.3 - scientific >=0.3.7.0 && <0.4 - - template-haskell >=2.16.0.0 && <2.18 + - template-haskell >=2.16.0.0 && <2.19 - text >=1.2.4.1 && <1.3 - - time >=1.9.3 && <1.10 + - time >=1.9.3 && <1.12 tests: haspara-test: