lib: lists: add 'mapFilter'

This commit is contained in:
Bruno BELANYI 2021-08-24 22:25:12 +02:00
parent 3736e3a415
commit 7d2c43d157

13
lib/lists.nix Normal file
View file

@ -0,0 +1,13 @@
{ lib, ... }:
let
inherit (lib) filter;
in
{
# Filter a list using a predicate function after applying a map.
#
# mapFilter ::
# (value -> bool)
# (any -> value)
# [ any ]
mapFilter = pred: f: attrs: filter pred (map f attrs);
}