From a46bf25230a1943763525caea10460a296d80470 Mon Sep 17 00:00:00 2001 From: Torsten Schmits Date: Thu, 3 Aug 2023 21:41:01 +0200 Subject: [PATCH] use lazy folds --- lib/default.nix | 6 +++--- lib/deps/cabal2nix.nix | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/default.nix b/lib/default.nix index d6a837e..ccceaaa 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -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 @@ -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); @@ -83,7 +83,7 @@ let else b; mergeAll' = z: items: - foldl' mergeAuto z items; + foldl mergeAuto z items; mergeAll = items: if length items == 0 diff --git a/lib/deps/cabal2nix.nix b/lib/deps/cabal2nix.nix index ea3e16b..e7e0006 100644 --- a/lib/deps/cabal2nix.nix +++ b/lib/deps/cabal2nix.nix @@ -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 []);