dotfiles/nixpkgs/overlays/lib/lists.nix
2021-12-23 04:34:47 +01:00

15 lines
305 B
Nix

final: prev:
let
inherit (prev.lib.trivial) const;
inherit (prev.lib.lists) range any all;
in prev.lib.lists // {
# a -> Int -> [a]
repeat = item: times: map (const item) (range 1 times);
# [Bool] -> Bool
any' = any (boolean: boolean);
# [Bool] -> Bool
all' = all (boolean: boolean);
}