release-haskell: add docs for removeMany and removePlatforms

launchpad/nixpkgs/master
(cdep)illabout 3 years ago
parent be8d8a9efb
commit f8592f6ba5
No known key found for this signature in database
GPG Key ID: 462E0C03D11422F4
  1. 29
      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:

Loading…
Cancel
Save