From 8044e2985445ca48ab5c64af7581452a8efbb800 Mon Sep 17 00:00:00 2001 From: Anton-Latukha Date: Thu, 13 May 2021 15:03:35 +0300 Subject: [PATCH 1/3] default.nix: upd rev --- default.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/default.nix b/default.nix index 0b37bb406..a0ad918b6 100644 --- a/default.nix +++ b/default.nix @@ -91,7 +91,7 @@ # , nixos-20.03 # Last stable release, gets almost no updates to recipes, gets only required backports # ... # } -, rev ? "39e6bf76474ce742eb027a88c4da6331f0a1526f" +, rev ? "65d6153aec85c8cb46023f0a7248628f423ca4ee" , pkgs ? if builtins.compareVersions builtins.nixVersion "2.0" > 0 @@ -188,7 +188,6 @@ let overrides = self: super: { - ref-tf = super.ref-tf_0_5; semialign = super.semialign_1_2; relude = super.relude_1_0_0_1; From b9349f3c51ac1e56c3dd5c050cc8f742d38119e7 Mon Sep 17 00:00:00 2001 From: Anton-Latukha Date: Thu, 13 May 2021 14:39:22 +0300 Subject: [PATCH 2/3] {Expr.Types, Parser}: m clean-up --- src/Nix/Expr/Types.hs | 6 +++--- src/Nix/Parser.hs | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/Nix/Expr/Types.hs b/src/Nix/Expr/Types.hs index 472ff768b..52864c506 100644 --- a/src/Nix/Expr/Types.hs +++ b/src/Nix/Expr/Types.hs @@ -662,10 +662,10 @@ ekey _ _ f e = fromMaybe e <$> f Nothing stripPositionInfo :: NExpr -> NExpr stripPositionInfo = transport phi where - transport f (Fix x) = Fix $ fmap (transport f) (f x) + transport f (Fix x) = Fix $ transport f <$> f x - phi (NSet recur binds) = NSet recur $ fmap go binds - phi (NLet binds body) = NLet (fmap go binds) body + phi (NSet recur binds) = NSet recur $ go <$> binds + phi (NLet binds body) = NLet (go <$> binds) body phi x = x go (NamedVar path r _pos) = NamedVar path r nullPos diff --git a/src/Nix/Parser.hs b/src/Nix/Parser.hs index 05efd61ce..c94b820aa 100644 --- a/src/Nix/Parser.hs +++ b/src/Nix/Parser.hs @@ -557,23 +557,23 @@ type Parser = ParsecT Void Text (State SourcePos) type Result a = Either (Doc Void) a parseFromFileEx :: MonadFile m => Parser a -> FilePath -> m (Result a) -parseFromFileEx p path = +parseFromFileEx parser file = do - txt <- decodeUtf8 <$> readFile path + input <- decodeUtf8 <$> readFile file pure $ either (Left . pretty . errorBundlePretty) - Right - $ (`evalState` initialPos path) $ runParserT p path txt + pure + $ (`evalState` initialPos file) $ runParserT parser file input parseFromText :: Parser a -> Text -> Result a -parseFromText p txt = - let file = "" in +parseFromText parser input = + let stub = "" in either (Left . pretty . errorBundlePretty) - Right - $ (`evalState` initialPos file) $ (`runParserT` file) p txt + pure + $ (`evalState` initialPos stub) $ (`runParserT` stub) parser input {- Parser.Operators -} From f4ea5dcb344369916586498ba33c00d0fc605a79 Mon Sep 17 00:00:00 2001 From: Anton-Latukha Date: Thu, 13 May 2021 14:40:01 +0300 Subject: [PATCH 3/3] cabal: dep: relude: require >= 1.0 Since reexports of basic packages were cleaned-up in Cabal dependencies, that included only in `relude`. Checked the constraints introduced - `relude` constraints are wide, they (currently) do not to already present version constraints, but of course add structurally. --- hnix.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hnix.cabal b/hnix.cabal index b92c68aa0..2202f8198 100644 --- a/hnix.cabal +++ b/hnix.cabal @@ -441,7 +441,7 @@ library , process >= 1.6.3 && < 1.7 , ref-tf >= 0.5 && < 0.6 , regex-tdfa >= 1.2.3 && < 1.4 - , relude >= 0.7.0 && < 1.1.0 + , relude >= 1.0.0 && < 1.1.0 , scientific >= 0.3.6 && < 0.4 , semialign >= 1 && < 1.3 , serialise >= 0.2.1 && < 0.3