nix-dotfiles/lib/lists.nix

15 lines
282 B
Nix
Raw Normal View History

{ stdlib }:
2022-03-07 16:01:52 +01:00
let
inherit (stdlib.trivial) const;
inherit (stdlib.lists) range any all;
in {
2022-03-07 16:01:52 +01:00
# a -> Int -> [a]
repeat = item: times: map (const item) (range 1 times);
# [Bool] -> Bool
any' = any (boolean: boolean);
# [Bool] -> Bool
all' = all (boolean: boolean);
}