packages feed

hnix 0.10.0 → 0.10.1

raw patch · 4 files changed

+85/−34 lines, 4 filesdep +gitrevPVP ok

version bump matches the API change (PVP)

Dependencies added: gitrev

API changes (from Hackage documentation)

+ Nix.Expr.Types: instance Data.Functor.Classes.Ord1 Nix.Expr.Types.Binding
+ Nix.Expr.Types: instance Data.Functor.Classes.Ord1 Nix.Expr.Types.NExprF
+ Nix.Expr.Types: instance Data.Functor.Classes.Ord1 Nix.Expr.Types.NKeyName

Files

CHANGELOG.md view
@@ -1,44 +1,62 @@+ # Changelog -## [0.10.0](https://github.com/haskell-nix/hnix/compare/0.9.1...0.10.0) (2020-09-12)+### [(diff)](https://github.com/haskell-nix/hnix/compare/0.10.0...0.10.1#files_bucket) 0.10.1 (2020-09-13) +* Additional:+  * [(link)](https://github.com/haskell-nix/hnix/pull/715/files) `{Binding, NExpr, NExprF, NKeyName}` gained `Ord1` instances.+    * These instances were required by downstream projects to be able to use newer HNix.+  * [(link)](https://github.com/haskell-nix/hnix/pull/712) CLI gained `--long-version` option for gathering a detailed debug information.+    * Currently, reports Git commit and its date.+    * [(link)](https://github.com/haskell-nix/hnix/issues/718) Currently does not work in case of use of the `nix-build`, in which case simply returns `UNKNOWN` placeholder.+++## [(diff)](https://github.com/haskell-nix/hnix/compare/0.9.1...0.10.0#files_bucket) 0.10.0 (2020-09-12)+ * Breaking:-  * [Remove `ToJSON` and `FromJSON` instances for `NExpr`](https://github.com/haskell-nix/hnix/pull/699)-    * This also removes the JSON output feature for unevaluated expression trees.+  * [(link)](https://github.com/haskell-nix/hnix/pull/699) Removed `NExpr` `{FromJSON, ToJSON}` instances.+    * This also removed the JSON output feature for unevaluated expression trees. -* Misc:-  * [Update `data-fix` dependency to `>= 0.3.0 && < 0.4`](https://github.com/haskell-nix/hnix/pull/686)-  * [Update `prettyprinter` dependency to `= 1.7.0 && < 1.8`](https://github.com/haskell-nix/hnix/pull/679)-  * [CLI recieved `--version` option](https://github.com/haskell-nix/hnix/pull/703)+* Additional:+  * [(link)](https://github.com/haskell-nix/hnix/pull/703) CLI gained `--version` option.+  * Dependencies:+    * [(link)](https://github.com/haskell-nix/hnix/pull/686) Requires last major `data-fix` (`0.3`).+    * [(link)](https://github.com/haskell-nix/hnix/pull/679) Requires last major `prettyprinter` (`1.7`). -## [0.9.1](https://github.com/haskell-nix/hnix/compare/0.9.0...0.9.1) (2020-07-13) -* Misc:-  * REPL improvements-    * Better tab completion-    * Multi-line input-    * Support for passing evaluated expression result of `hnix --eval -E`-      to REPL as `input` variable.-    * Support for loading `.hnixrc` from current directory-  * Reporting of `builtins.nixVersion` bumped from 2.0 to 2.3+### [(diff)](https://github.com/haskell-nix/hnix/compare/0.9.0...0.9.1#files_bucket) 0.9.1 (2020-07-13)++* Additional:+  * REPL:+    * Better tab completion.+    * Accepting multi-line input.+    * Support for passing evaluated expression result of `hnix --eval -E`.+      to REPL as an `input` variable.+    * Support for loading `.hnixrc` from the current directory.+  * Reporting of `builtins.nixVersion` bumped from 2.0 to 2.3.   * Dependencies:-    * Freed from: `interpolate`, `contravariant`, `semigroups`, `generic-random`, `tasty-quickcheck`-    * `repline >= 0.4.0.0 && < 0.5`+    * Freed from: `{interpolate, contravariant, semigroups, generic-random, tasty-quickcheck}`.+    * Requires last major `repline` (`0.4`). -## [0.9.0](https://github.com/haskell-nix/hnix/compare/0.8.0...0.9.0) (2020-06-15) -* Changelog started. Previous release was `0.8.0`. In new release:+## [(diff)](https://github.com/haskell-nix/hnix/compare/0.8.0...0.9.0#files_bucket) 0.9.0 (2020-06-15)  * Breaking:-  * Removed instances due to migration to `haskeline >= 0.8 && < 0.9`:-    * `instance MonadException m => MonadException(StateT(HashMap FilePath NExprLoc) m)`-    * `instance MonadException m => MonadException(Fix1T StandardTF m)`+  * Removed instances due to migration to `haskeline 0.8`:+    * `instance MonadException m => MonadException(StateT(HashMap FilePath NExprLoc) m)`.+    * `instance MonadException m => MonadException(Fix1T StandardTF m)`.+  * Dependencies:+    * Requires last major `haskeline` (`0.8`). -* Misc:-  * Library: Official support for `GHC 8.4 - 8.10`+* Additional:+  * Library: Official support for `GHC 8.4 - 8.10`.+  * Executable complies only under `GHC 8.10`. +* Changelog started. Previous release was `0.8.0`.++ --- -`HNix` uses [PVP Versioning][1].+HNix uses [PVP Versioning][1].  [1]: https://pvp.haskell.org
hnix.cabal view
@@ -1,5 +1,5 @@ name:           hnix-version:        0.10.0+version:        0.10.1 synopsis:       Haskell implementation of the Nix language description:    Haskell implementation of the Nix language. category:       System, Data, Nix@@ -398,6 +398,7 @@     , exceptions >= 0.10.0 && < 0.11     , filepath >= 1.4.2 && < 1.5     , free >= 5.1 && < 5.2+    , gitrev >= 1.1.0 && < 1.4     , hashable >= 1.2.5 && < 1.4     , hashing >= 0.1.0 && < 0.2     , hnix-store-core >= 0.1.0 && < 0.3
src/Nix/Expr/Types.hs view
@@ -387,6 +387,13 @@   liftEq _  (StaticKey  a) (StaticKey  b) = a == b   liftEq _  _              _              = False +-- | @since UNRELEASED+instance Ord1 NKeyName where+  liftCompare cmp (DynamicKey a) (DynamicKey b) = liftCompare2 (liftCompare cmp) cmp a b+  liftCompare _   (DynamicKey _) (StaticKey _)  = LT+  liftCompare _   (StaticKey _)  (DynamicKey _) = GT+  liftCompare _   (StaticKey a)  (StaticKey b)  = compare a b+ instance Hashable1 NKeyName where   liftHashWithSalt h salt (DynamicKey a) =     liftHashWithSalt2 (liftHashWithSalt h) h (salt `hashWithSalt` (0 :: Int)) a@@ -491,7 +498,9 @@ $(deriveEq1 ''Antiquoted) $(deriveEq2 ''Antiquoted) +$(deriveOrd1 ''NExprF) $(deriveOrd1 ''NString)+$(deriveOrd1 ''Binding) $(deriveOrd1 ''Params) $(deriveOrd1 ''Antiquoted) $(deriveOrd2 ''Antiquoted)
src/Nix/Options/Parser.hs view
@@ -1,3 +1,5 @@+{-# LANGUAGE TemplateHaskell #-}+ module Nix.Options.Parser where  import           Control.Arrow                  ( second )@@ -8,8 +10,11 @@ import           Data.Time import           Nix.Options import           Options.Applicative     hiding ( ParserResult(..) )-import           Data.Version                   (showVersion)-import           Paths_hnix                     (version)+import           Data.Version                   ( showVersion )+import           Development.GitRev             ( gitCommitDate+                                                , gitBranch+                                                , gitHash )+import           Paths_hnix                     ( version )  decodeVerbosity :: Int -> Verbosity decodeVerbosity 0 = ErrorsOnly@@ -183,12 +188,30 @@           )         ) +--  2020-09-12: CLI --version option mechanism is tied to meta modules specificly generated by Cabal. It is possible to use Template Haskell to resolve the version, as also a g versionOpt :: Parser (a -> a)-versionOpt = infoOption-              (showVersion version)-              (  long "version"-              <> help "Show release version"-              )+versionOpt = shortVersionOpt <*> debugVersionOpt+ where+  shortVersionOpt :: Parser (a -> a)+  shortVersionOpt = infoOption+    (showVersion version)+    (  long "version"+    <> help "Show release version"+    )++  --  2020-09-13: NOTE: Does not work for direct `nix-build`s, works for `nix-shell` `cabal` builds.+  debugVersionOpt :: Parser (a -> a)+  debugVersionOpt = infoOption+    ( concat+        [ "Version: ", showVersion version+        , "\nCommit: ", $(gitHash)+        , "\n  date: ", $(gitCommitDate)+        , "\n  branch: ", $(gitBranch)+        ]+    )+    (  long "long-version"+    <> help "Show long debug version form"+    )  nixOptionsInfo :: UTCTime -> ParserInfo Options nixOptionsInfo current = info (helper <*> versionOpt <*> nixOptions current)