From 433c8864ea3d204914d88a5d2f125d0603a4ef24 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Mon, 16 Nov 2020 11:59:11 +0100 Subject: [PATCH] Add divisor generator --- garlic/tools.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/garlic/tools.nix b/garlic/tools.nix index 4402de3..a3aef52 100644 --- a/garlic/tools.nix +++ b/garlic/tools.nix @@ -57,6 +57,9 @@ let in _divList N; + # A list of all divisors of n, sorted in increased order: + divisors = n: filter (x: (mod n x == 0)) (range 1 n); + # Generates a set given a list of keys, where all values are null. genNullAttr = l: genAttrs l (name: null);