From f8592f6ba511ecc75c8b51ea84c41d4d2f688591 Mon Sep 17 00:00:00 2001 From: "(cdep)illabout" Date: Sun, 18 Jul 2021 18:15:49 +0900 Subject: release-haskell: add docs for removeMany and removePlatforms --- pkgs/top-level/release-haskell.nix | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'pkgs/top-level') diff --git a/pkgs/top-level/release-haskell.nix b/pkgs/top-level/release-haskell.nix index 233da8ee1b6d..9ae66ab44149 100644 --- a/pkgs/top-level/release-haskell.nix +++ b/pkgs/top-level/release-haskell.nix @@ -81,8 +81,37 @@ let recursiveUpdateMany = builtins.foldl' lib.recursiveUpdate {}; + # Remove multiple elements from a list at once. + # + # removeMany + # :: [a] -- list of elements to remove + # -> [a] -- list of elements from which to remove + # -> [a] + # + # > removeMany ["aarch64-linux" "x86_64-darwin"] ["aarch64-linux" "x86_64-darwin" "x86_64-linux"] + # ["x86_64-linux"] removeMany = itemsToRemove: list: lib.foldr lib.remove list itemsToRemove; + # Recursively remove platforms from the values in an attribute set. + # + # removePlatforms + # :: [String] + # -> AttrSet + # -> AttrSet + # + # > attrSet = { + # foo = ["aarch64-linux" "x86_64-darwin" "x86_64-linux"]; + # bar.baz = ["aarch64-linux" "x86_64-linux"]; + # bar.quux = ["aarch64-linux" "x86_64-darwin"]; + # } + # > removePlatforms ["aarch64-linux" "x86_64-darwin"] attrSet + # { + # foo = ["x86_64-linux"]; + # bar = { + # baz = ["x86_64-linux"]; + # quux = []; + # }; + # } removePlatforms = platformsToRemove: packageSet: lib.mapAttrsRecursive (_: val: -- cgit 1.4.1