lib: move lib extensions into its own module argument

This commit is contained in:
2022-11-19 16:14:18 +01:00
parent 9bc5d2e85d
commit b3aa6cad81
13 changed files with 70 additions and 83 deletions

14
lib/lists.nix Normal file
View File

@@ -0,0 +1,14 @@
{ stdlib }:
let
inherit (stdlib.trivial) const;
inherit (stdlib.lists) range any all;
in {
# a -> Int -> [a]
repeat = item: times: map (const item) (range 1 times);
# [Bool] -> Bool
any' = any (boolean: boolean);
# [Bool] -> Bool
all' = all (boolean: boolean);
}