Skip to content

Commit

Permalink
Merge #934: Cabal: dep: relude: require >= 1.0; upd Nixpkgs rev
Browse files Browse the repository at this point in the history
Was pretty careful with use of reexports. Library builds great with `0.7` relude, thou before release I cleaned-up the Cabal dependencies, which introduced dependency on reexports provided in `relude`, which indeed were introduced in `1.0`.

To extimate the constraints, checked the bounds introduced to what HNix had. The package bounds are on stable packages and have big timescale bounds, nothing got restricted. Thou it added another structural dependency.

In reality pretty ready to see & evaluate the new base & prelude.
  • Loading branch information
Anton-Latukha authored May 13, 2021
2 parents 8aee668 + f4ea5dc commit 9f873ca
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
3 changes: 1 addition & 2 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion hnix.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/Nix/Expr/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 8 additions & 8 deletions src/Nix/Parser.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "<string>" in
parseFromText parser input =
let stub = "<string>" in
either
(Left . pretty . errorBundlePretty)
Right
$ (`evalState` initialPos file) $ (`runParserT` file) p txt
pure
$ (`evalState` initialPos stub) $ (`runParserT` stub) parser input

{- Parser.Operators -}

Expand Down

0 comments on commit 9f873ca

Please sign in to comment.