Commit graph

723 commits

Author SHA1 Message Date
Anton-Latukha ffc82fc97e
clean-up: LANGUAGE pragmas
M  Setup.hs
M  main/Repl.hs
M  src/Nix/Builtins.hs
M  src/Nix/Cache.hs
M  src/Nix/Cited.hs
M  src/Nix/Cited/Basic.hs
M  src/Nix/Convert.hs
M  src/Nix/Exec.hs
M  src/Nix/Expr/Types.hs
M  src/Nix/Expr/Types/Annotated.hs
M  src/Nix/Lint.hs
M  src/Nix/Normal.hs
M  src/Nix/Pretty.hs
M  src/Nix/Render/Frame.hs
M  src/Nix/Scope.hs
M  src/Nix/TH.hs
M  src/Nix/Thunk.hs
M  src/Nix/Thunk/Basic.hs
M  src/Nix/Utils.hs
M  src/Nix/Value.hs
M  src/Nix/Value/Equal.hs
2020-09-14 20:54:37 +03:00
Simon Jakobi dfa0435e9e Fix since annotation 2020-09-13 19:13:08 +03:00
Anton Latukha 1beaf46cd3
Options/Parser: debugVersionOpt: comment: add nix-build note (#717)
[Remark](https://github.com/haskell-nix/hnix/pull/712#issuecomment-691654639) deserves a comment note in the source code.
2020-09-13 14:10:27 +03:00
Anton Latukha 83c5cea9a4
Options/Parser: add '--long-version' that adds debug information (#712)
Option for debugging and bugreporting purposes.

Current output:
```
Version: 0.9.1
Commit: 2dc211314e
  date: Sat Sep 12 13:31:59 2020 +0300
  branch: 2020-09-12-add-GitRev-to-version
```

Also date and branch is to direct contributors attention to updating (or having
in mind) that.

M  hnix.cabal
M  src/Nix/Options/Parser.hs
2020-09-13 13:51:14 +03:00
Simon Jakobi 775be0d234 Add Ord1 instances for Binding, NExprF, and NKeyName
With data-fix 0.3, these instances are required so an
Ord instance for NExpr can be inferred.
2020-09-13 12:47:24 +03:00
Anton-Latukha 2dc211314e src/Nix/Options/Parser.hs: m upd alignment 2020-09-12 13:31:59 +03:00
Anton-Latukha 38215317b9 src/Nix/Options/Parser.hs: add CLI option --version 2020-09-12 13:31:59 +03:00
Simon Jakobi 93ecf531c4 Remove overlapping [From,To]JSON instances for NExpr
…for compatibility with aeson-1.5.3.

Closes #690.
2020-08-19 15:22:33 -07:00
Simon Jakobi 1a2d627a58 Use prettyprinter-1.7.0
Changelog:
http://hackage.haskell.org/package/prettyprinter-1.7.0/changelog

hnix is likely to be affected by this change:

> Use floor instead of round to compute ribbon width.

…due to its use of custom `LayoutOptions`.
2020-08-07 12:21:12 +03:00
Simon Jakobi 54030284fa Update to data-fix-0.3
Changelog: http://hackage.haskell.org/package/data-fix-0.3.0/changelog

Context: https://github.com/commercialhaskell/stackage/issues/5535
2020-07-24 12:35:59 +03:00
Richard Marko 06edd4b8cf builtins.nixVersion: version 2.0 -> 2.3
Nixpkgs now has minimum required version 2.2, this allows us to
import it again.
2020-07-11 19:18:07 +03:00
Simon Jakobi b4e3b3b2f4
Improve the documentation in Nix.{Atoms,Expr.Types} (#662)
This also removes some commented out TH from the haddocks
2020-07-03 01:35:30 +02:00
Simon Jakobi 220209c090
Use neat-interpolation instead of interpolate (#635)
In addition to `interpolate`, this also removes the following
transitive dependencies:

 - `haskell-src-exts`
 - `haskell-src-meta`
 - `safe`
 - `th-expand-syns`
 - `th-lift`
 - `th-lift-instances`
 - `th-orphans`
 - `th-reify-many`

Since `neat-interpolation`'s `text` quasiquoter trims more whitespace
than `interpolate`'s `i`, the expected output of some tests for
`unsafeGetAttrPos` had to be updated.

This also improves the test failure output of the `constantEqual`
helper.

Fixes #634.
2020-06-27 10:43:50 +02:00
Simon Jakobi f0532b86f6
Silence redundant import warnings for Control.Monad.Fail (#633)
Also address mysterious redundant import warnings in the testsuite

This allows us to enable `buildStrictly=true` for GHC 8.8.

Fixes #613.
2020-06-19 02:21:06 +02:00
Anton-Latukha 8ebb26f371
src/Nix/Type/Infer.hs: clean-up imports
M  src/Nix/Type/Infer.hs
2020-06-03 02:37:39 +03:00
Anton-Latukha b72bfe86c9
src/Nix/Builtins.hs: clean-up imports
M  src/Nix/Builtins.hs
2020-06-03 02:37:39 +03:00
Anton-Latukha 20667e55c6
src/Nix/Parser.hs: clean-up imports
M  src/Nix/Parser.hs
2020-06-03 02:37:39 +03:00
Anton-Latukha 48f1dbb13a
clean-up Monad.Trans imports
M  src/Nix/Exec.hs
M  src/Nix/Reduce.hs
2020-06-03 02:37:39 +03:00
Anton-Latukha 76ab909958
clean-up Monoid imports
M  main/Repl.hs
M  src/Nix/Expr/Strings.hs
M  src/Nix/Utils.hs
2020-06-02 02:11:50 +03:00
Anton-Latukha 83c483d160
src/Nix/Value.hs: clean-up imports, clen-up GHC warning
M  src/Nix/Value.hs
2020-06-02 01:38:39 +03:00
Simon Jakobi 9c6003ae8b
Use haskeline-0.8 (#540)
The `MonadException` class was removed in favor of `MonadCatch`, so we
can remove its instances, enabling us to remove the library dependency
on haskeline.

To simplify dependency resolution with GHC < 8.10, this also disables
the executable in that configuration.
2020-05-30 03:32:20 +02:00
Simon Jakobi 707060260a
Clean up hashing-related dependencies (#597)
Background: https://github.com/haskell-nix/hnix/issues/588#issuecomment-634692400
2020-05-30 02:28:50 +02:00
Simon Jakobi a2b9980e2c
Fix build failure in Nix.Var (#587)
The `Refl` constructor had previously been re-exported from
`Data.GADT.Compare`.

This also replaces the dependency on `dependent-sum` with `some`,
where the `Data.GADT.Compare` module is now defined.

Tested by building locally with GHC 8.4.4, 8.6.5 and 8.8.3 in `cabal`.

Fixes #585.
2020-05-25 20:28:26 +03:00
Richard Marko 192202d939 remove leftover Poly README 2020-05-15 17:51:58 -07:00
Richard Marko c61abbe6c0 pretty derivation builtin nix 2020-05-15 17:50:21 -07:00
Silvan Mosberger f682907c97 Make URI's be separate from strings 2020-05-15 17:49:11 -07:00
John Wiegley 9d63f952e9
Merge remote-tracking branch 'sjakobi/ghc-gte-8.4' 2020-01-13 18:13:37 -08:00
John Wiegley 71804374ce
Merge remote-tracking branch 'quasi/monadfail' 2020-01-13 17:56:33 -08:00
Guillaume Maudoux 975d6dea93 Refactor execBinaryOp to demand values where needed.
This spliste execBinaryOp in two parts where the second conatains all
the logic that relies on the assumption that values are already in
"demanded".
2019-11-27 17:16:43 -08:00
Guillaume Maudoux 45c72cd20e fixup: undo spurious space change 2019-11-26 14:32:29 -07:00
Guillaume Maudoux 4ded48a789 Add proper default 'nix' prefix to search paths
The search path of Nix contains by default the "nix" prefix that points
to $datadir/nix/corepkgs, where $datadir defaults to $prefix/lib at
installation time, but can be overriden by NIX_DATA_DIR.

We implemented it using `Paths.hnix.getDataDir` and `NIX_DATA_DIR` to
follow Nix behaviour as closely as possible.

A small discrepancy is that we do the lookup on each invocation, where
Nix caches the searchPath at context creation.
2019-11-26 14:32:29 -07:00
Guillaume Maudoux 21c3c9c938 Fix compound attributes in let bindings
Fix an issue where compound attributes would discard previous bindings
in a let statement.

`let a=1; b.b=2; c=3; in a` would fail, where
`let a=1; b.b=2; c=3; in c` would work as expected.
2019-11-25 15:22:39 -07:00
Simon Jakobi 5c8c1cc16f We unconditionally depend on deepseq >= 1.4.3 now 2019-10-22 00:18:12 +02:00
Simon Jakobi ff39add9af Remove instance for old binary versions 2019-10-22 00:05:52 +02:00
Simon Jakobi 5f4cef9922 We unconditionally have hashable >= 1.2.5 now 2019-10-22 00:03:52 +02:00
Simon Jakobi 4cd94bf687 Remove some redundant GHC version checks 2019-10-21 23:52:22 +02:00
Simon Jakobi 8ed7d765dd Require base >= 4.11
There were multiple build failures with GHC-8.2 due
to (<>) and Semigroup not being in scope.
2019-10-21 23:46:35 +02:00
quasicomputational 37c2bb25da Adapt to MonadFail changes in GHC 8.8.
Note that this is an enforced public API change.

I went with changing the `MonadFile` typeclass rather than threading
through a `MonadFail` at every use-site, but that would be possible as
well if it makes more semantic sense - however, since `MonadFile`
already seems to require an IO-ish implementation, adding that
superclass doesn't seem like an imposition.
2019-10-02 08:04:17 +01:00
quasicomputational 91262e7602 Allow most recent versions of dependencies.
The only actual breaking change affecting `hnix` is `these` splitting
into three packages and renaming some things. Otherwise, as the
package should work fine with either the newer or older versions, I
have left the previous bounds in place and added the new ones
disjunctively.

This will help somewhat with #494.
2019-09-06 13:19:14 -07:00
Anton-Latukha c03a40acea upd texts of more messages
Heterogeneous: consisting of dissimilar elements.

Heterogenous:
  1. not originating within the body;
  (ex: "You are NOT of the body!" by Dr. Leonard "Bones" McCoy)
  2. of foreign origin;
  3. heterogeneous.
2019-08-04 15:00:57 -07:00
Anton-Latukha e3f5eafd7b upd texts of messages 2019-08-04 12:52:22 -07:00
Anton-Latukha 4758c014e5 Thunk: Basic: LANGUAGE: rm {LambdaCase,TypeApplications} 2019-08-04 09:14:41 -07:00
Anton-Latukha 63b4496621 Standard: LANGUAGE: rm {LambdaCase,TupleSections,ViewPatterns} 2019-08-04 09:14:41 -07:00
Anton-Latukha dda464a8ec Render: LANGUAGE: rm TypeApplications 2019-08-04 09:14:41 -07:00
Anton-Latukha 150c1086a3 Pretty: LANGUAGE: rm TupleSectioning 2019-08-04 09:14:41 -07:00
Anton-Latukha e50a2272b3 Lint: LANGUAGE: rm StandaloneDeriving 2019-08-04 09:14:41 -07:00
Anton-Latukha 9baacd3b2d Fresh: LANGUAGE: rm {DefaultSignatures,FunctionalDependencies} 2019-08-04 09:14:41 -07:00
Anton-Latukha 34af384870 Var: LANGUAGE: rm Derive{Foldable,Functor,Traversable} 2019-08-04 09:14:41 -07:00
Anton-Latukha f258d00796 Exec: LANGUAGE: rm {DeriveFunctor,GeneralizedNewtypeDeriving,ViewPatterns} 2019-08-04 09:14:41 -07:00
Anton-Latukha 61dfbca2e3 Eval: LANGUAGE: rm FunctionalDependencies 2019-08-04 09:14:41 -07:00