Skip to content

Commit

Permalink
use lazy folds
Browse files Browse the repository at this point in the history
  • Loading branch information
tek committed Aug 3, 2023
1 parent 1564ed3 commit a46bf25
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 3 additions & 3 deletions lib/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ let

mergeOverrides = zipAttrsWith (_: concatLists);

concatOverrides = foldl' (a: b: toList a ++ toList b) [];
concatOverrides = foldl (a: b: toList a ++ toList b) [];

normalizeOverrides = project: deps: depsFull:
let
Expand All @@ -48,7 +48,7 @@ let
unlinesConcatMap = f: xs: concatStringsSep "\n" (concatMap f xs);

foldAttrs =
foldl' lib.mergeAttrs {};
foldl lib.mergeAttrs {};

foldMapAttrs = f: xs:
foldAttrs (map f xs);
Expand Down Expand Up @@ -83,7 +83,7 @@ let
else b;

mergeAll' = z: items:
foldl' mergeAuto z items;
foldl mergeAuto z items;

mergeAll = items:
if length items == 0
Expand Down
3 changes: 1 addition & 2 deletions lib/deps/cabal2nix.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
{pkgs}: let

modifiers = import ./modifiers.nix { inherit pkgs; };
spec = import ./spec.nix { inherit (pkgs) lib; };
util = import ../default.nix { inherit (pkgs) lib; };

inherit (spec) transform transform_ decl;
inherit (spec) decl;

hackageDrv = meta: {self, pkg, options, ...}:
self.callHackageDirect { inherit (meta) ver sha256; inherit pkg; } (util.foldAttrs options.cabal2nix-overrides or []);
Expand Down

0 comments on commit a46bf25

Please sign in to comment.