Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cabal: dep: relude: require >= 1.0; upd Nixpkgs rev #934

Merged
merged 3 commits into from
May 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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