summary refs log tree commit diff
path: root/pkgs/top-level
diff options
context:
space:
mode:
author(cdep)illabout <cdep.illabout@gmail.com>2021-07-18 18:15:49 +0900
committer(cdep)illabout <cdep.illabout@gmail.com>2021-07-24 21:13:41 +0900
commitf8592f6ba511ecc75c8b51ea84c41d4d2f688591 (patch)
treea63498b53b51c03be0504ca2244f8245eb5b0000 /pkgs/top-level
parentbe8d8a9efba330011c848a0f86b7b4a815d34ec2 (diff)
downloadnixpkgs-f8592f6ba511ecc75c8b51ea84c41d4d2f688591.tar
nixpkgs-f8592f6ba511ecc75c8b51ea84c41d4d2f688591.tar.gz
nixpkgs-f8592f6ba511ecc75c8b51ea84c41d4d2f688591.tar.bz2
nixpkgs-f8592f6ba511ecc75c8b51ea84c41d4d2f688591.tar.lz
nixpkgs-f8592f6ba511ecc75c8b51ea84c41d4d2f688591.tar.xz
nixpkgs-f8592f6ba511ecc75c8b51ea84c41d4d2f688591.tar.zst
nixpkgs-f8592f6ba511ecc75c8b51ea84c41d4d2f688591.zip
release-haskell: add docs for removeMany and removePlatforms
Diffstat (limited to 'pkgs/top-level')
-rw-r--r--pkgs/top-level/release-haskell.nix29
1 files changed, 29 insertions, 0 deletions
diff --git a/pkgs/top-level/release-haskell.nix b/pkgs/top-level/release-haskell.nix
index 233da8ee1b6..9ae66ab4414 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: